Analytics Traffic
Analytics Traffic API provides endpoints to retrieve analytics and traffic data for a project, including Google Search Console metrics, keyword traffic potential, and estimated SEO performance.
Get Google Search Console data
GET https://api4.seranking.com/analytics/{site_id}/google
Returns popular queries and performance metrics from Google Search Console for the specified site.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| site_id | Integer | Yes | Project (site) ID (path parameter). |
Request example
GET https://api4.seranking.com/analytics/1/googleResponse parameters
If successful, the server returns the 200 HTTP status code and an array of queries with performance metrics. Returns HTTP 400 if the site is not shared with the account (for more information, see Error handling).
| Parameter | Type | Description |
|---|---|---|
| query | String | Search query. |
| impressions | Integer | Number of impressions. |
| clicks | Integer | Number of clicks. |
| ctr | Float | Click-through rate (%). |
| avg | Float | Average position. |
Response example
[
{
"query": "text",
"impressions": 100,
"clicks": 10,
"ctr": 10,
"avg": 5
},
...
]Calculate SEO potential
GET https://api4.seranking.com/analytics/{site_id}/potential
Estimates traffic, cost, and potential leads for the specified site.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| site_id | Integer | Yes | Project (site) ID (path parameter). |
| top_n | Integer | No | If specified, calculates potential traffic assuming all queries reach the TOP. Otherwise, returns the current traffic estimate for queries added to the system. |
| lead_price | Float | No | Estimated income per client. |
| conversion_rate | Float | No | Conversion rate to sales (%). |
Request example
GET https://api4.seranking.com/analytics/1/potential/?top_n=10&lead_price=50&conversion_rate=100Response parameters
If successful, the server returns the 200 HTTP status code and an array of traffic forecasts per search engine. Returns HTTP 400 if site_id is not valid (for more information, see Error handling).
| Parameter | Type | Description |
|---|---|---|
| site_engine_id | Integer | Unique ID of the search engine configuration within the project. |
| traffic | Integer | Estimated traffic. |
| traffic_value | Float | Estimated cost of traffic. |
| leads_qty | Integer | Estimated number of clients. |
| leads_price | Float | Estimated profit from leads. |
Response example
[
{
"site_engine_id": 586,
"traffic": 1,
"traffic_value": 5.85,
"leads_qty": 0,
"leads_price": 0
},
...
]