SerpBear
Search
K

API Documentation

With SerpBear you can use the built-in API for your reporting tools like Google Data Studio.

Authentication

Serpbear uses Basic Authorization with Bearer Token to authenticate requests. In your Requests, you need to set a Authorization header with the value Bearer APIKEY . The API key is set by you in the .env file.

API Endpoints

SerpBear exposes the following routes that can be consumed with the API key:
GET: /api/keyword => Get the data of a keyword.
GET: /api/keywords => Get all the keywords of a domain.
GET: /api/domains => Get all the Domains.
POST: /api/refresh => Refresh the SERP positions of given keyword IDs.
POST: /api/cron => Immediately scrape the positions for all the keywords.
POST: /api/notify => Instantly Receive all keyword Positions as an email to your Inbox.

GET: /api/keyword

Get the full data of a keyword.
https://myserpbearinstance.com/api/keyword?id=22
Parameters:
- id (Integer) => The Keyword ID.
Success Response:
{
"keyword": {
"ID": 2,
"keyword": "compress image",
"device": "desktop",
"country": "US",
"domain": "getbrave.io",
"lastUpdated": "2022-11-27T02:21:32.910Z",
"added": "2022-11-22T02:21:32.910Z",
"position": 14,
"history": {
"2022-11-25": 12,
"2022-11-26": 16,
"2022-11-27": 14
},
"url": "https://compressimage.io/",
"tags": [],
"lastResult": [],
"sticky": false,
"updating": false,
"lastUpdateError": "false"
}
}

GET: /api/keywords

Get all the keywords of a given domain name.
https://myserpbearinstance.com/api/keywords?domain=mydomain.com
Parameters:
- domain (string) => Domain name.
Success Response:
{
"keywords": [{
"ID": 2,
"keyword": "compress image",
"device": "desktop",
"country": "US",
"domain": "getbrave.io",
"lastUpdated": "2022-11-27T02:21:32.910Z",
"added": "2022-11-22T02:21:32.910Z",
"position": 14,
"history": {
"2022-11-25": 12,
"2022-11-26": 16,
"2022-11-27": 14
},
"url": "https://compressimage.io/",
"tags": [],
"lastResult": [],
"sticky": false,
"updating": false,
"lastUpdateError": "false"
}]
}

GET: /api/domains

Get all the domains.
https://myserpbearinstance.com/api/domains
Parameters: None
Success Response:
{
"domains": [
{
"ID": 1,
"domain": "getbrave.io",
"slug": "getbrave-io",
"keywordCount": 0,
"lastUpdated": "2022-11-22T02:21:32.910Z",
"added": "2022-11-22T02:21:32.910Z",
"tags": "[]",
"notification": true,
"notification_interval": "never",
"notification_emails": ""
}
]
}