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();
Each request need an authentification.
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": [], }
Each request is sent on POST. Each response is returned on JSON format. Response fields are the following :
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.", }
Get data and analyze results from a webpage on several criteria.
Cost : 1 page analysis credits
http://www.website.com/page.html
Invalid URL or timeout
Unable to get data
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":... }, ... } }
Cost : 1 backlink credit
website.com
domain
Parameters missing
No data on this domain
$params = array( 'domain' => 'website.com', 'type' => 'domain', ); $result = $Api->call('backlinks/create', $params);
{ }
Cost : 0 credits
The report may take a few seconds to be generated. The report is generated when the isProcessed value is equal to 1.
123
1
Parameters missing
Does not exist or is not completed
$params = array( 'id' => '123', 'page' => '1', ); $result = $Api->call('backlinks/get', $params);
{ }
Cost : 1 suggestion credit
website.com
us
100
Parameters missing
No data on this domain
$params = array( 'domain' => 'website.com', 'database' => 'us', ); $result = $Api->call('seobenchmark/create', $params);
{ }
Cost : 1 suggestion credit
keyword 1, keyword 2
US
en
Parameters missing
Parameters invalid
No data
$params = array( 'keywords' => 'keyword 1, keyword 2', 'location' => 'US', 'language' => 'en' ); $result = $Api->call('keywordresearch/create', $params);
{ }
Return the list of crawl reports created.
INTERNAL_ERROR
$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 }, ... ]
Cost : 1 paged crawled credit / page crawled
http://www.website.com
1000
false
false
NO_CREDITS
LIMIT_CRAWLED_EXCEDEED
INVALID_URL
INTERNAL_ERROR
$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}
1234
INVALID_CRAWL
INTERNAL_ERROR
$params = array( "id" => 1234, ); $result = $Api->call('crawl/stop', $params);
{"stopping":true}
Get crawl metrics: state of the crawl process and the number of errors of each categories.
1234
INVALID_CRAWL
INTERNAL_ERROR
$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 } }
List crawled pages. This call use pagination.
1234
ALL
1
INVALID_CRAWL
INVALID_FILTER
INVALID_PAGINATE
INTERNAL_ERROR
$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 }, ... ] }
Get detailed page analysis of each crawled URL.
1234
INVALID_CRAWL
PAGE_NOT_CRAWLED
INTERNAL_ERROR
$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 }, ... ] } }
Create a rank tracking group : ranktracking/create
Cost : none
my rank tracking
website.com
website.com
website.com
website.com
website.com
website.com
google.com
en
Miami,Florida,United States
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', } }
Delete a rank tracking group : ranktracking/delete
Cost : None
1234
Parameters missing
$params = array( 'id'=>'123', ); $result = $Api->call('ranktracking/delete', $params);
{ "action":"ranktracking/delete", "version":"5.1", "code":200, "data":{ 'id'=>'12345', } }
Add keywords to a rank tracking group : ranktracking/add
Cost : 1 rank tracking unit / keyword
1234
['keyword 1', 'keyword 2']
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', } }
Remove a keyword from a rank tracking group : ranktracking/remove
Cost : None, -1 rank tracking unit / keyword
1234
keyword 1
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', } }
Get a keyword's ranks history : ranktracking/history
Cost : None
1234
keyword 1
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}, } } }
Get a all group keywords rank on a defined date : ranktracking/summary
Cost : None
1234
2017-01-30
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 } ] } }
Get a SERP (Search engine result page) on a defined data and a defined keyword : ranktracking/serp
Cost : None
1234
keyword 1
2017-01-30
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" }, ... ] } }