Introduction
API Endpoint
https://linksindexer.com/api/
Links Indexer offers a simple REST-based JSON API enabling you to automatically create campaigns from your system.
In case You are in need of a test API Key to test Your code implementations and integration simply register Yourself an account (it is absolutely free to register) and then Contact Us to set Your account to a developer one!
Overview
The Links Indexer API provides an easy interface for programmers to embed Links Indexer functions in their own programs or online services directly. The Links Indexer API is very easy to use - it uses HTTP Requests to receive Your commands, process them and return You a json response.
With API you can create new campaigns, Set Dripfeed Days, Get remaining days credits and even index links with your XML RPC requests.
The Links Indexer API can hendel both GET and POST requests.
Authentication
The API Authentication of Links Indexer Can be done with api_token that you can get from Links Indexer Settings Page. By simply passing api_token as a request body parameter or url query parameter. Either way will be accepted.
Variables and CODES
If your query fails, the Links Indexer API will return a 3 Variables, an internal error type, and a plain text "info" object containing suggestions for the user.
{
"success": false,
"message": "Input Fields Validation Error",
"errors": {
"api_token": [
"API Token is required"
],
"urls": [
"URLS are required"
]
}
}
HTTP | KEY | Description |
---|---|---|
200/404 | success | If the API request is success or not. The API will return the boolean true or false based on query response. |
200 | message | It will give success message or if any error its short description. |
200 | api_token | This is an API Authentication Key generated by our system for each single client. It is used to authenticate as the corresponding user. Every our customer can find his API Key inside the settings page at links indexer. |
200 | campaign_name | A campaign name under which the URLs sent will be assigned. Campaigns are used in our system to help out customers organize their submitted URLs by groups. If this variable is omitted or is left blank our system will create a campaign with current date time stamp. If a campaign with the name provided already exists, our system will automatically add some random characters to the end of it. |
104 | dripfeed | Specifies Scheduling options. There are 3 possible options. |
dripfeed=0 | If this variable is omitted or left blank our system will set a default value of Drip feed all links within 2 days. | |
dripfeed=7 | It will accept integer only and only upto 15. It will make all links dripfeeding with a defined number of days. | |
| The number of links submitted daly can be calcumated by (number of links) / (number of days) = (pinged links per day) | |
200 | urls | This is a string collection of all URLs that will be sent to our system. Delimiter between each URL is | (single pipe) without any spaces or new lines. If more links than the available user's remaining daily limit are tried to be submitted, our system will accept only that much as the remaining limit is available! |
422 | rate_limit | If anyone tries multiple attempt of any api function with INVALID api_token our system will block the user entirely for few seconds and time will increase if multiple failed attemps are recorded. It is referred to as the "Rate Limits" section of the API Documentation. |
[GET] HEALTH
Example Code :
<?php
$api_token='YOUR_API_KEY_HERE';
// build the POST/GET query string
$qstring='api_token='.$api_token;
// Do the API Request using CURL functions
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://linksindexer.com/api/health-check',
CURLOPT_POSTFIELDS => $qstring,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
Response :
{
"success" : true,
"timestamp":"Mon, Dec 11, 2023 10:41 AM" //current time in IST
}
https://linksindexer.com/api/health-check
This API Endpoint will return current time. You can use it to determine if our api is working on not.
[GET] Links Limit
Example Code :
<?php
$api_token='YOUR_API_KEY_HERE';
// build the POST/GET query string
$qstring='api_token='.$api_token;
// Do the API Request using CURL functions
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://linksindexer.com/api/credits',
CURLOPT_POSTFIELDS => $qstring,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
Response :
{
"success": true,
"message": 50000
}
https://linksindexer.com/api/credits
This API Endpoint will return your Todays remaining upload limits. You can determine if you should send next requests or not. Its not necesarry. If you run out of credits our system will automatically reject next request.
PARAMETERS
PARAMS | DESCRIPTION |
---|---|
api_token | To authenticate with the Links Indexer API, simply attach your api_token to the base endpoint URL: |
[POST] - Create Campaign
Example Code :
<?php
$api_token='YOUR_API_KEY_HERE';
$campaign_name='CAMPAIGN_NAME_HERE'; //OPTIONAL
// All URLS to be sent are hold in an array for example
$urls=array('http://www.example.com','http://www.example.com/title');
// build the POST query string and join the URLs array with | (single pipe)
$qstring='api_token='.$api_token.'&campaign_name='.$campaign_name.'&urls='.urlencode(implode('|',$urls));
// Do the API Request using CURL functions
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://linksindexer.com/api/campaign/create',
CURLOPT_POSTFIELDS => $qstring,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
Response :
{
"success": true,
"message": "API Campaign 2022-06-18 00:35:01 is successfully created!"
}
https://linksindexer.com/api/campaign/create
All API Campaigns will have default 7 days dripfeed
. Means links submitted today will be scheduled for pinging tomorrow. You can attach dripfeed=0
for immediate indexing.
Campaigns with same name created on same day will be merged.
Example. If Campaign named ABC was created today at 1 AM with 100 links and new campaign is created with same name as ABC on 3 AM. Campaign created on 3 AM will be merged with Campaign Created on 1 AM. This improvement is to avoid multiple campaigns with very few links. If Campaign with same name is created on second day it wont be merged with a old campaign which was created yesterday.
So don’t panic if you don’t see new API Campaigns separately.
PARAMETERS
PARAMS | DESCRIPTION |
---|---|
api_token | To authenticate with the Links Indexer API, simply attach your api_token to the base endpoint URL: |
campaign_name | A campaign name under which the URLs sent will be assigned. Campaigns are used in our system to help out customers organize their submitted URLs by groups. If this variable is omitted or is left blank our system will create a campaign with current date time stamp. |
urls | This is a string collection of all URLs that will be sent to our system. Delimiter between each URL is | (single pipe) without any spaces or new lines. If more links than the available user's remaining daily limit are tried to be submitted, our system will accept only that much as the remaining limit is! |
dripfeed | How many days to dripfeed the links? Provide only integer and upto 15. |