Introduction

The Site Analyzer API provides all features of Site Analyzer system, in order to integrate them in your applications. Our API works on REST (Representational State Transfer), and return JSON formatted responses.

# This is a JSON formatted response example.

{
	"name":"value",
}# This is a PHP request example.

# Switch between PHP and JSON response in the top navigation.

$Api = new SiteAnalyzerApi();

Authentification

Each request need an authentification.

  1. Use our PHP client Download PHP client
  2. Get API credentials (client_public et client_secret)
  3. The authentification is needed on each API call.

Requests are sent at the address :
https://api.site-analyzer.com/5.1/ACTION_NAME

The opposite code (on the right) is a request and authentification example.

# Request example

include('site-analyzer-api-client.php');
$Api = new SiteAnalyzerApi();
$Api->set_client_public('YOUR_CLIENT_PUBLIC_KEY');
$Api->set_client_secret('YOUR_CLIENT_SECRET_KEY');
$params = array(
	'PARAM_NAME'=>'PARAM_VALUE',
);
$res = $Api->call('ACTION_NAME', $params);
# Response example

{
	"action": "ACTION_NAME",
	"version": "5.1",
	"code": "200",
	"data": [],
}

Response

Each request is sent on POST. Each response is returned on JSON format. Response fields are the following :

  • action : Feature name used.
    Example : "action": "pageanalysis",
  • version : API version.
    Example : "version": "5.1",
  • code : HTTP response code. See table above.
    Example : "code": "200",
  • data : If no error, the request result.
    Example : "data": [],
  • error : If error (code != 200), error message.
    Example : "error": "Authentification failed",

Error codes and description :

Code Description
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
422 Unprocessable Entity
500 Internal Server Error

include('site-analyzer-api-client.php');
$Api = new SiteAnalyzerApi();
$Api->set_client_public('YOUR_CLIENT_PUBLIC_KEY');
$Api->set_client_secret('YOUR_CLIENT_SECRET_KEY');
$params = array(
	'PARAM_NAME'=>'PARAM_VALUE',
);
$res = $Api->call('ACTION_NAME', $params);

# Response
$response = json_decode($res, true);
if($response['code'] != 200)
{
	echo $response['error'];
} 
else
{
	$data = $response['data'];
}
# Example of success

{
	"action": "ACTION_NAME",
	"version": "5.1",
	"code": "200",
	"data": [],
}

# Example of error

{
	"action": "ACTION_NAME",
	"version": "5.1",
	"code": "403",
	"error": "Authentification failed.",
}

Page Analysis

About

Get data and analyze results from a webpage on several criteria.
Cost : 1 page analysis credits

Parameters

url
string URL of the page to analyze
http://www.website.com/page.html

Response

id
int ID of the created analysis
url
String Final url
score
float Global score
score_seo
float Score on SEO category
score_design
float Score on Design category
score_content
float Score on Content category
score_performance
float Score on Performance category
score_accessibility
float Score on Accessibility category
analysis
Array Result of each criteria. See below :
"criteriaName"
Array
n
String Criteria Name
s
int Score (From 0 to 100)
d
Array Data. Depending of the criteria. See PageAnalyzer Criteria for further details.
t
int Result type.
0 for information,
1 for success,
2 for warning,
3 for critical.
c
int Criteria coefficient.

Errors

Invalid URL or timeout
Invalid URL or timeout.
Unable to get data
Page does not exists.
Unable to crawl website : blocked by robots.txt
Unable to crawl website, blocked by robots.txt.
$params = array(
	'url' => 'http://www.website.com/page.html',
);
$result = $Api->call('pageanalysis/create', $params);
{"0":
	{"n":
		{ "d": [ ... ],
		  "t":..,
		  "s":..,
		  "e":[...],
		  "c":...
		},
		...
	}
}
		

Seo Benchmark

$params = array(
	'domain' => 'website.com',
	'database' => 'us',
);
$result = $Api->call('seobenchmark/create', $params);
{
	
}	

Keyword research

$params = array(
	'keywords' => 'keyword 1, keyword 2',
	'location' => 'US',
	'language' => 'en'
);
$result = $Api->call('keywordresearch/create', $params);
{
	
}	

Crawls List

Return the list of crawl reports created.

Parameters

Response

Array
Array See exemple structure.

Errors

INTERNAL_ERROR
An internal error has occurred. Please try again or contact us.
$params = array();
$result = $Api->call('crawl/list', $params);

[
	{
		"id": "1234",
		"creation_date_time": "2018-06-25 07:50:06",
		"url": "http://www.website.com/",
		"limit_crawled": 1000,
		"use_sitemaps": false,
		"crawl_url_with_param": false
	},
	...
]	

Crawl Create

About

Cost : 1 paged crawled credit / page crawled

Parameters

url
string URL
http://www.website.com
limit_crawled
int Maximal number of pages to crawl (max 1 000 000)
1000
use_sitemaps
bool
false
crawl_url_with_param
bool Follow urls with get parameters ("?param=value")
false

Response

id
int ID of the created crawl

Errors

NO_CREDITS
There is not enough Page to Crawl credits left in your account.
LIMIT_CRAWLED_EXCEDEED
If the number of pages to crawled is greater than 1 000 000.
INVALID_URL
The URL sent does not exists or is malformed.
INTERNAL_ERROR
An internal error has occurred. Please try again or contact us.
$params = array(
	'url' => 'http://www.website.com/',
	'limit_crawled' => 1000,
	'use_sitemaps' => false,
	'crawl_url_with_param' => false
);
$result = $Api->call('crawl/create', $params);
{"id":1234}		

Crawl Stop

Parameters

id
int Id of your create crawl
1234

Response

stopping
bool Crawl is being stopped.

Errors

INVALID_CRAWL
The ID of the crawl does not exists.
INTERNAL_ERROR
An internal error has occurred. Please try again or contact us.
$params = array(
	"id" => 1234,
);
$result = $Api->call('crawl/stop', $params);

{"stopping":true}	

Crawl Get Overview

About

Get crawl metrics: state of the crawl process and the number of errors of each categories.

Parameters

id
int Id of your create crawl
1234

Response

funnel
Array Errors counters used in the funnel chart (see the Site Analyzer interface)
overviews
Array Detailed counters of each categories
progress
Array Metrics of the crawl progress.

Errors

INVALID_CRAWL
The ID of the crawl does not exists.
INTERNAL_ERROR
An internal error has occurred. Please try again or contact us.
$params = array(
	'id' => 1234,
);
$result = $Api->call('crawl/overview', $params);

{
   "funnel":{
      "SCORE":"0.7778",
      "DISCOVERED":50,
      "NOT_EXPLORABLE":14,
      "EXPLORABLE":36,
      "BROKEN":0,
      "VALID":36,
      "REDIRECTION":4,
      "NOT_REDIRECTION":32,
      "NOT_INDEXABLE":0,
      "INDEXABLE":32,
      "DUPLICATED":1,
      "UNIQUE":31,
      "SLOW":0,
      "COMPLIANT":28,
      "CONTENT_ISSUE":3,
      "RICH_CONTENT":28
   },
   "overviews":{
      "EXPLORATION":{
         "ALL":50,
         "EXPLORABLE":36,
         "NOT_EXPLORABLE":14,
         "UNAUTHORIZED_URL_SIZE":0,
         "UNAUTHORIZED_URL_RULE":14,
         "UNAUTHORIZED_ROBOTS_TXT":0,
         "UNAUTHORIZED_NOFOLLOW":0,
         "UNAUTHORIZED_FILTERED":0
      },
      "BROKEN":{
         "ALL":36,
         "VALID":36,
         "BROKEN":0,
         "BROKEN_404":0,
         "BROKEN_4XX":0,
         "BROKEN_5XX":0,
         "BROKEN_TIMEOUT":0,
         "BROKEN_ERROR":0
      },
      "REDIRECTION":{
         "ALL":36,
         "NOT_REDIRECTION":32,
         "REDIRECTION":4,
         "REDIRECTION_PERMANENT":2,
         "REDIRECTION_TEMPORARY":2,
         "REDIRECTION_META_REFRESH":0,
         "REDIRECTION_HEADER_REFRESH":0,
         "REDIRECTION_LOOP":0
      },
      "INDEXATION":{
         "ALL":32,
         "INDEXABLE":32,
         "NOT_INDEXABLE":0,
         "NOT_INDEXABLE_META_NOINDEX":0,
         "NOT_INDEXABLE_HEADER_NOINDEX":0,
         "NOT_INDEXABLE_NOT_HTML":0
      },
      "DUPLICATED":{
         "ALL":32,
         "UNIQUE":31,
         "CANONIZED_URL":1,
         "DUPLICATED_INTERNAL_CANONICAL":1,
         "DUPLICATED_OUTGOING_CANONICAL":0,
         "DUPLICATED_INVALID_CANONICAL":0,
         "DUPLICATED_DUPLICATED_URL":0
      },
      "CONTENT_ISSUE":{
         "ALL":31,
         "CONTENT_VALID":28,
         "CONTENT_ISSUE":3,
         "CONTENT_ISSUE_QUANTITY_TITLE":0,
         "CONTENT_ISSUE_QUANTITY":3,
         "CONTENT_ISSUE_TITLE":0
      },
      "PAGE_SPEED":{
         "ALL":28,
         "COMPLIANT":28,
         "SLOW":0,
         "PAGE_SLOW_TTFB_FLT":0,
         "PAGE_SLOW_TTFB":0,
         "PAGE_SLOW_FLT":0
      }
   },
   "progress":{
      "is_running":false,
      "ignored":14,
      "to_do":0,
      "done":36
   }
}

Crawl Get Pages List

About

List crawled pages. This call use pagination.

Parameters

id
int Id of your create crawl
1234
filter
string Values:
ALL,
EXPLORABLE,
NOT_EXPLORABLE,
UNAUTHORIZED_URL_SIZE,
UNAUTHORIZED_URL_RULE,
UNAUTHORIZED_ROBOTS_TXT,
UNAUTHORIZED_NOFOLLOW,
UNAUTHORIZED_FILTERED VALID,
BROKEN,
BROKEN_404,
BROKEN_4XX,
BROKEN_5XX,
BROKEN_TIMEOUT,
BROKEN_ERROR NOT_REDIRECTION,
REDIRECTION,
REDIRECTION_PERMANENT,
REDIRECTION_TEMPORARY,
REDIRECTION_META_REFRESH,
REDIRECTION_HEADER_REFRESH,
REDIRECTION_LOOP,
INDEXABLE,
NOT_INDEXABLE,
NOT_INDEXABLE_META_NOINDEX,
NOT_INDEXABLE_HEADER_NOINDEX,
NOT_INDEXABLE_NOT_HTML UNIQUE,
CANONIZED_URL,
DUPLICATED_INTERNAL_CANONICAL,
DUPLICATED_OUTGOING_CANONICAL,
DUPLICATED_INVALID_CANONICAL,
DUPLICATED_DUPLICATED_URL CONTENT_VALID,
CONTENT_ISSUE,
CONTENT_ISSUE_QUANTITY_TITLE,
CONTENT_ISSUE_QUANTITY,
CONTENT_ISSUE_TITLE,
COMPLIANT,
PAGE_SLOW,
PAGE_SLOW_TTFB_FLT,
PAGE_SLOW_TTFB,
PAGE_SLOW_FLT
ALL
paginate
int Page to return (default 1)
1

Response

paginate
Array Details of the pagination.
pages
Array List of pages. See exemple.

Errors

INVALID_CRAWL
The ID of the crawl does not exists.
INVALID_FILTER
The filter parameter does not exists.
INVALID_PAGINATE
The pagination parameters are wrong.
INTERNAL_ERROR
An internal error has occurred. Please try again or contact us.
$params = array(
	'id' => 1234,
	'filter' => 'COMPLIANT',
	'paginate' => 1
);
$result = $Api->call('crawl/pages', $params);

{
   "paginate":{
      "current":1,
      "total":1,
      "results":28,
      "results_per_page":100
   },
   "pages":[
   	  {
         "url":"https:\/\/www.website.com\/en\/contact",
         "source":"https:\/\/www.website.com\/",
         "crawl_status":"COMPLIANT",
         "http_status":200,
         "redirect":"",
         "canonical":"https:\/\/www.website.com\/en\/contact",
         "title":"Contact us",
         "meta_description":"",
         "unique_keywords":118,
         "keywords":192,
         "top_keywords":[
            "contact us",
            "website ready optimized",
            "us",
            "start free trial",
            "bank card required"
         ],
         "ttfb_ms":"113",
         "full_load_time_ms":"1796",
         "total_page_weight_mb":"1.22",
         "number_of_requests":30
      }, 
      ...
    ]
}	

Crawl Get Page Analysis

About

Get detailed page analysis of each crawled URL.

Parameters

id
int Id of your create crawl
1234
url
string Crawl Url to return

Response

mixed
mixed See exemple (JSON response).

Errors

INVALID_CRAWL
The ID of the crawl does not exists.
PAGE_NOT_CRAWLED
This page has not been crawled.
INTERNAL_ERROR
An internal error has occurred. Please try again or contact us.
$params = array(
	'id' => 1234,
	'url' => 'https://www.website.com/en/contact'
);
$result = $Api->call('crawl/page', $params);

{
	"url": "https://www.website.com/en/contact",
	"source": "https://www.website.com/",
	"crawl_status": "COMPLIANT",
	"redirect": "",
	"canonical": "https://www.website.com/en/contact",
	"exploration": {
		"http_status": 200,
		"http_content_type": "text/html",
		"is_https": true
	},
	"meta_data": {
		"indexability": "INDEXABLE",
		"global_nofollow": false,
		"robots_instructions": {
			"x_robots_tag_headers": [
				"noarchive"
			],
			"meta_robots": "",
			"meta_googlebot": ""
		},
		"title": {
			"content": "Contact us",
			"length": 10
		},
		"meta_description": {
			"content": "",
			"length": 0
		},
		"language": {
			"header": "",
			"meta_http_equiv": "",
			"lang": "en"
		},
		"refresh": {
			"header": "",
			"meta_http_equiv": ""
		},
		"canonical": {
			"header": "",
			"meta": "https://www.website.com/en/contact"
		},
		"charset": {
			"header": "utf-8",
			"meta_http_equiv": ""
		},
		"doctype": "html"
	},
	"meta_links": {
		"first": {
			"header": "",
			"meta": ""
		},
		"last": {
			"header": "",
			"meta": ""
		},
		"next": {
			"header": "",
			"meta": ""
		},
		"prev": {
			"header": "",
			"meta": ""
		},
		"alternates": {
			"headers": [
				{
					"href": "https://www.website.com/fr/contact",
					"media": "",
					"lang": "fr",
					"type": ""
				},
				...
			],
			"metas": [
				{
					"href": "https://www.website.com/fr/contact",
					"media": "",
					"lang": "fr",
					"type": ""
				},
				...				
			]
		}
	},
	"performance": {
		"ttfb_ms": "113",
		"full_load_time_ms": "1796",
		"total_page_weight_mb": "1.22",
		"number_of_requests": 30
	},
	"mobile": {
		"meta_viewport": "width=device-width, initial-scale=1.0",
		"amp": {
			"is_amp": false,
			"amp_link": ""
		},
		"twitter_app": {
			"iphone_link": "",
			"ipad_link": "",
			"googleplay_link": ""
		}
	},
	"content": {
		"keyword_quantity": 192,
		"keyword_unique": 118,
		"keyword_unique_quantity_ratio": 0.6146,
		"text_code_ratio": 0.0246,
		"keywords": [
			{
				"keyword": "contact us",
				"optimization": "OPTIMIZED",
				"count": 3,
				"density": 0.0309,
				"weighted_density": 0.1358,
				"tags": [
					{
						"tags": [
							"title"
						],
						"count": 1
					},
					{
						"tags": [
							"h1"
						],
						"count": 1
					},
					{
						"tags": [
							"a"
						],
						"count": 1
					}
				]
			},
			...
		]
	},
	"h_titles": {
		"count": {
			"total": 7,
			"h1": 1,
			"h2": 1,
			"h3": 4,
			"h4": 0,
			"h5": 0,
			"h6": 1
		},
		"titles": [
			{
				"tag": "h1",
				"content": "Contact us"
			},
			...
		]
	},
	"images": [
		{
			"type": "VALID",
			"source": "https://www.website.com/static/img/website-logo.svg",
			"alt": "Website company."
		},
		...
	],
	"links": {
		"outgoing_links": {
			"count": {
				"EXTERNAL": 9,
				"INTERNAL": 34,
				"total": 43
			},
			"links": [
				{
					"to": "http://help.website.com/en/support/home",
					"anchor": "Help",
					"is_follow": true,
					"type": "EXTERNAL"
				},
				...
			]
		},
		"internal_in_links": {
			"count": {
				"LINK": 20,
				"START": 0,
				"SITEMAP": 0,
				"REDIRECTION": 0,
				"CANONICAL": 0,
				"PAGING": 0,
				"ALTERNATE": 0,
				"total": 20
			},
			"links": [
				{
					"from": "https://www.website.com/",
					"anchor": "Contact us",
					"is_follow": true,
					"type": "LINK"
				},
				...
			]
		}
	},
	"duplicates": {
		"duplicated_content": 2,
		"pages": [
			{
				"url": "https://www.website.com/contact",
				"is_title_duplicated": true,
				"is_description_duplicated": true,
				"is_content_duplicated": true,
				"content_duplicated_ratio": 1
			},	
			...		
		]
	}
}	
	

Rank tracking Create

About

Create a rank tracking group : ranktracking/create
Cost : none

Parameters

name
string - required Group name
my rank tracking
url
string - required Domain name (with www or not)
website.com
competitor1
string Domain name (with www or not)
website.com
competitor2
string Domain name (with www or not)
website.com
competitor3
string Domain name (with www or not)
website.com
competitor4
string Domain name (with www or not)
website.com
competitor5
string Domain name (with www or not)
website.com
engine
string - required Search engine
google.com
lang
string - required Search language (2 letters)
en
location
string - optional Geolocated city
Miami,Florida,United States

Response

id
int Id of the created group

Errors

Parameters missing
Parameters missing
$params = array(
	'name'=>'site analyzer US',
	'url'=>'www.site-analyzer.com',
	'engine'=>'google.com',
	'lang'=>'en',
	'competitor1'=>'website.com',
);
$result = $Api->call('ranktracking/create', $params);

{
	"action":"ranktracking/create",
	"version":"5.1",
	"code":200,
	"data":{
		'id'=>'12345',
		'name'=>'site analyzer US',
		'url'=>'www.site-analyzer.com',
		'engine'=>'google.com',
		'lang'=>'en',
		'competitor1'=>'website.com',
	}
}

Rank tracking Delete group

About

Delete a rank tracking group : ranktracking/delete
Cost : None

Parameters

id
int - required id of the group
1234

Response

id
int Id of the created group

Errors

Parameters missing
Parameters missing
$params = array(
	'id'=>'123',
);
$result = $Api->call('ranktracking/delete', $params);

{
	"action":"ranktracking/delete",
	"version":"5.1",
	"code":200,
	"data":{
		'id'=>'12345',
	}
}

Rank tracking Add keywords

About

Add keywords to a rank tracking group : ranktracking/add
Cost : 1 rank tracking unit / keyword

Parameters

id
int - required id of the group
1234
keywords
array of strings - required Array of keywords
['keyword 1', 'keyword 2']

Response

id
int Id of the created group
nbOfKeywordsAdded
int Number of keywords added.

Errors

Parameters missing
Parameters missing
$params = array(
	'id'=>'123',
	'keywords'=>[
		'keyword 1',
		'keyword 2',
	],
);
$result = $Api->call('ranktracking/add', $params);

{
	"action":"ranktracking/add",
	"version":"5.1",
	"code":200,
	"data":{
		'id'=>'12345',
		'nbOfKeywordsAdded'=>'2',
	}
}

Rank tracking Remove keyword

About

Remove a keyword from a rank tracking group : ranktracking/remove
Cost : None, -1 rank tracking unit / keyword

Parameters

id
int - required id of the group
1234
keyword
string The keyword string
keyword 1

Response

id
int Id of the created group
keywordRemoved
string The keyword removed

Errors

Parameters missing
Parameters missing
$params = array(
	'id'=>'123',
	'keyword'=>'keyword 1',
);
$result = $Api->call('ranktracking/remove', $params);

{
	"action":"ranktracking/remove",
	"version":"5.1",
	"code":200,
	"data":{
		'id'=>'12345',
		'keywordRemoved'=>'keyword 1',
	}
}

Rank tracking Keyword Ranks history

About

Get a keyword's ranks history : ranktracking/history
Cost : None

Parameters

id
int - required id of the group
1234
keyword
string The keyword string
keyword 1

Response

id
int Id of the created group
keyword
string The keyword
ranks
string List of ranks

Errors

Parameters missing
Parameters missing
$params = array(
	'id'=>'123',
	'keyword'=>'keyword 1',
);
$result = $Api->call('ranktracking/history', $params);

{
	"action":"ranktracking/history",
	"version":"5.1",
	"code":200,
	"data":{
		'id'=>'12345',
		'keyword'=>'keyword 1',
		'ranks'=>	{
			"2017-03-15":
				{"rank":null,"link":null,"title":null},
		}
	}
}

Rank tracking Summary

About

Get a all group keywords rank on a defined date : ranktracking/summary
Cost : None

Parameters

id
int - required id of the group
1234
date
YYYY-MM-DD The date on format YYYY-MM-DD
2017-01-30

Response

id
int Id of the created group
www.website.com
Array Array of ranks

Errors

Parameters missing
Parameters missing
$params = array(
	'id'=>'123',
	'date'=>'2017-03-15',
);
$result = $Api->call('ranktracking/summary', $params);

{
	"action":"ranktracking/summary",
	"version":"5.1",
	"code":200,
	"data":{
		'id'=>'12345',
		'www.site-analyzer.com': [
			{
				"date":"2017-03-15",
				"keyword":"keyword 1",
				"ranks": [
					{
						"link":"https:\/\/www.site-analyzer.com\/",
						"rank":1,
						"title":"Site Analyzer: Website Analysis and SEO Tools"
					}
				],
				"bestRank":1
			}
		]	
	}
}

Rank tracking Keyword SERP

About

Get a SERP (Search engine result page) on a defined data and a defined keyword : ranktracking/serp
Cost : None

Parameters

id
int - required id of the group
1234
keyword
string The keyword string
keyword 1
date
YYYY-MM-DD The date on format YYYY-MM-DD
2017-01-30

Response

id
int Id of the created group
keyword
string The keyword
date
YYYY-MM-DD The date on format YYYY-MM-DD
serp
Array The SERP result (SEO and SEA)

Errors

Parameters missing
Parameters missing
$params = array(
	'id'=>'123',
	'keyword'=>'keyword 1',
	'date'		=>'2017-03-15',
);
$result = $Api->call('ranktracking/serp', $params);

{
	"action":"ranktracking/serp",
	"version":"5.1",
	"code":200,
	"data":{
		'id'		=>'12345',
		'keyword'	=>'site analyzer',
		'date'		=>'2017-03-15',
	    'serp'=> [
	  	  {
		    "link":"https:\/\/www.site-analyzer.com\/",
		    "rank":1,
		    "rankSea":1,
		    "title":"Site Analyzer: Website Analysis and SEO Tools",
		    "type":"seo"
		  },
		  ...
	    ]
	}
}