SEO API: Creating Optimal Content through Entity SEO

The Internet is vast and building a tool or widget that can help writers outrank their competition on Google search is a challenge. To solve this problem, InLInks have now released an SEO API that any python, PHP or java developer can easily use to build reports that help search engine optimizers to analyse all the entities related to any keyphrase, by category. SEOs will be able to build these into CMS systems or their own content audit reports. The API also utilizes the powerful NLP algorithm to create a knowledge graph of entities from any set of web pages the operator chooses – offering Google Search, Bing News or up to 10 custom URLs to seed each knowledge graph.

There are many tools that help with keyword research, but very few that proactively help inform good content writers what things to talk about without trying to put words in the content writer’s mouth. A content brief should be able to inform a writer as to the topics that their target audience needs to read, without trying to take away the flair of the writer to inform or entertain. The InLinks SEO API seeks to help developers build integrations for SEOs that lets them create great content that they can be confident is better than their competitors.

What the SEO API does

The operator gets to choose the data that will be analyzed. They should first do their keyword research and – in the absence of any other data – this is the minimum input required. (If the operator does not have access to a keyword research tool, inLinks Trends might help.)

Data Main Input options:

  • Customer ID (mandatory)
  • API Key (Mandatory) – available to any inLinks customer on Level 4 ($156/mth) or above from today
  • The keyword or phrase (mandatory) – this is alphanumeric only
  • Language (a two-letter code) and Market (select from a list)
  • A target URL (optional, if If the user is trying to improve existing content)
  • Select a data source (Google Search is the default, but Bing news is also offered) OR
  • Up to ten Knowledge Graph training URLs

The SEO API Output

The API does NOT currently return JSON-LD or raw data. Instead, the data is used to generate an operator modified content brief report on the inLinks server like this one, which I generated for this post.

Content Audit: SEO API output. You can use your own logo.

Users can also now modify the logo and effectively white label the content as well – more about this below. At POST request receipt, InLinks will:

  • Check if API key and customer ID match
  • Check if the customer has enough credits for this
  • Check if the parameters sent are correct. If parameters are incorrect: API returns “invalid” for the related parameter
  • If there are not enough credits, the API returns “upgrade your plan”   If everything is OK, the API:
    • Returns a status 200 code, accompanied with the brief ID
    • Saves the keyword
    • If List of URLs is empty: performs the related Google Search to retrieve the URLs to be analysed, else do nothing
    • Create Article ID (in the Content Briefs project of the customer)
    • Save URLs to be analysed
    • Puts the brief ID in API queue
    • Creates a temporary brief file (with a waiting label)
    • Articles are then reviewed and analysed as they are in our online tool (through a CRON job) and when all the articles (URLs) have been analyzed the CRON job replaces the report URL output with the Content Brief output.

This response means that the developer will know the exact URL that the end audit will be on, even though the work has been queued. The brief ID is all the developer need to know as the report will be at a URL in this format:[brief_ID].html

Incidentally, if you also use the InLinks front end, an editable content brief is also created in your dashboard with the URL syntax:[brief_id]&pid=[Project_ID]

How to Find your SEO API Key

Your API key is in “My Account”. You must have a level 4 subscription

The programming code sample in PHP

Here is some sample PHP code you can use to call the API

<?php /* Markets List
‘FR-FR’ – French – France
‘FR-CA’ – French – Canada
‘FR-BE’ – French – Belgium
‘EN-US’ – ENglish – United States
‘EN-UK’ – English – UK
‘EN-CA’ – English – Canada
‘EN-AU’ – English – Australia
‘EN-IN’ – English – India
‘EN-NZ’ – English – New Zealand
‘EN-ZA’ – English – SOuth Africa
‘EN-IE’ – English – Ireland
‘EN-SG’ – English – Singapore
‘EN-MY’ – English – Malaysia
$urls = array() ;

$searchType = 1 ; // 1 = Google Search // 2= Bing News ;

$keyword = ‘YOUR KEYWORD’ ;

$customer_id = ‘YOUR CUSTOMER ID’ ;

$api_key = ‘YOUR API KEY’ ;

$market = ‘EN-US’ ; // see market list above

$refURL = ‘URL TO AUDIT’ ; // LEFT BLANK FOR A CONTENT BRIEF $doc = array();

$doc[‘keyword’] = $keyword ;
$doc[‘urls’] = $urls ;
$doc[‘market’] = $market ;
$doc[‘cid’] = $customer_id ;
$doc[‘search’] = $searchType ;
$doc[‘refURL’] = $refURL ;

$payload = json_encode($doc) ;

if (!$payload) { echo ‘Invalid Payload’ ; exit() ; }

$url = ‘’ . $api_key . ‘&payload=’ .$payload ;
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘Content-Type:application/json’));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$results = json_decode(curl_exec($ch));
curl_close ($ch);
echo ‘<br/>Code: ‘.$results->code ; // 200: OK
echo ‘<br/>Msg: ‘.$results->msg ; // If code = 200: return the brief URL


API programming code sample in Python and other languages

If anyone can translate the PHP code above into other programming languages, we would be delighted to share the code here and cite you as a source. Just start in the comments and we can add the code to the main text of the article. Please tell us what URL we should cite if users have questions for you (or want you to program a widget for them).

Possible uses of the SEO API

I decided to leave you with a few ideas for using the API. I am sure there are many – but some obvious ones stand out.

White labelling

Obviously, if you have your own system or tools, this will be helpful to build into your workflow. The URL that is returned can be used “headless” to embed into your own tools.

Make a Google Docs interface

Lots of content writers like to use Google docs to create and edit content. What if you used this to compare the Google Doc draft with the knowledge graph? The content writer would then be spared editing their content in the inLinks editor itself.

Make a WordPress Plugin

Oh, this is SUCH a no-brainer. We do not have the resources right now to build a WordPress plugin, but this would be SO cool, especially if you could expose the writer’s DRAFT content to the API somehow. If you think you can build this, we have an affiliate program (or just give us a quote?)

Your Lead Generation Widget

You could very easily simply use this to generate leads for your own agency. A simple web form that requests the user to enter their own keyword, web page and email address are all you need to email them a link to their audit, which can be all branded with your own logo and you have them in your CRM funnel. By then time they read the email, the CRON job will probably be complete… but waiting for a little while might add some personality to your follow up email.

Share this entry



0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *