Internal Linker API is designed to help websites implement additional internal linking on pages as easily and fast as possible.
Two core principles were applied by developing the API: Speed and Reliability.
Every daemon queries the database and loads all the data in memory. Queries API is basically an operation that reads data from RAM. Usually, it takes less than 1 millisecond (1/1000 = thousand parts per second). Additional time is required by processing HTTPS requests on load balancers, which adds 10-15ms on top.
For reliability, we had one thing in mind: what is possible to fail will fail sooner or later. We deployed tens of API daemons and load balancers in different geolocations with redundancy. We designed a fallback even in the case when all databases and replicas fail. Every daemon dumps the actual database copy on its server. If a database is inaccessible, the API daemon will continue to use the existing data in memory. A daemon restarted, and there is no database connection? The dumped data will be used, and the API will work normally.
Servers in different GEO locations have the same data. You may query any location.
Http connection available as well.
Every API request should have an authorization header:
Sandbox does not require authorization.
Returns the list of internal links that should be placed on the page. The method does not make any queries to a database. The prepared links list is always in the daemon memory and returned in a fraction of the time. Usually, no need to cache the results of API calls on your side.
Example:
GET https://us.octolinker.com/v1/get-links?url=https://example.com/some-page.html
Parameters:
Response status codes:
Sandbox:
curl -H "X-Api-Key: some-key" "https://sandbox.octolinker.com/v1/get-links?url=https://example.com/some-page.html"
Response format:
{
"url" : "https://example.com/some-page.html", // the requested URL
"dateUpdated": "2024-07-01 12:00:00", // the date of the links list is the last update on the page.
"links": [
{
"urlTo" : "https://example.com/other-page.html", // link URL
"anchor": "Other Page", // text of the link
// the list of additional attributes, which may be helpfull such as product price, stock amount
"attributes": {
"someAttribute" : "someValue", // attributes keys and values are always strings
"otherAttribute": "123"
}
},
{
"urlTo" : "https://example.com/other-page.html", // link URL
"anchor": "Other Page", // text of the link
"attributes": {} // the attributes list is not fixed and depends on how internal links are generated.
}
// the list goes on
]
}
If links are not found:
{
"url": "https://example.com/some-page.html", // the requested URL
"dateUpdated": null,
"links": []
}
Returns the information about present internal linking in the system for the specific host.
Example:
GET https://us.octolinker.com/v1/links-info?url=https://example.com
Parameters: no parameters for method
Response status codes:
Sandbox:
curl -H "X-Api-Key: some-key" "https://sandbox.octolinker.com/v1/links-info?url=https://example.com/some-page.html"
Response format:
{
"dateUpdated": "2024-07-01 12:00:00", // the date of any last change in the interal linking list
"countDonorsPages": 12345, // the total amount of donor pages (where links should be placed)
"countAcceptorsPages": 234123 // the total number of acceptors pages (links pointing to those pages from donors)
}
Exports all active links into a CSV file. The file is generated on the fly, it may take a few seconds to prepare it.
Example:
curl -H "X-Api-Key: some-key" "https://us.octolinker.com/v1/export-links?url=https://example.com"
Response status codes: