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"
        ]
    }
}
HTTPKEY Description
200/404successIf the API request is success or not. The API will return the boolean true or false based on query response.
200messageIt will give success message or if any error its short description.
200api_tokenThis 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.
200campaign_nameA 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.
104dripfeedSpecifies Scheduling options. There are 3 possible options.
dripfeed=0If this variable is omitted or left blank our system will set a default value of Drip feed all links within 2 days.
dripfeed=7It will accept integer only and only upto 15. It will make all links dripfeeding with a defined number of days.
formulaThe number of links submitted daly can be calcumated by (number of links) / (number of days) = (pinged links per day)
200urlsThis 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!
422rate_limitIf 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.


[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

PARAMSDESCRIPTION
api_tokenTo authenticate with the Links Indexer API, simply attach your api_token to the base endpoint URL:
campaign_nameA 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.
urlsThis 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!
dripfeedHow many days to dripfeed the links? Provide only integer and upto 15.