Keyword Groups
Keyword Groups API provides endpoints to manage keyword groups within a project.
Add keyword group
POST https://api4.seranking.com/keyword-groups
Creates a new keyword group for the specified project.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Name of the keyword group to create. |
| site_id | Integer | Yes | Project (site) ID to which the group will be added. |
Request example
POST https://api4.seranking.com/keyword-groups
{"name": "groupname","site_id": 1}Response parameters
If successful, the server returns the 201 HTTP status code. Returns HTTP 400 if no name or site ID is specified and HTTP 404 if the site is not found (for more information, see Error handling).
| Parameter | Type | Description |
|---|---|---|
| group_id | Integer | ID of the created keyword group. |
Response example
{ "group_id": 123456 }Move keywords to another group
POST https://api4.seranking.com/keyword-groups/{group_id}/keywords
Moves the specified keywords to the target keyword group.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| group_id | Integer | Yes | Target keyword group ID (path parameter). |
| keyword_ids | Array | Yes | Array of keyword IDs to move. |
Request example
POST https://api4.seranking.com/keyword-groups/123/keywords
{ "keyword_ids": [1,2,3,4,5] }Response parameters
If successful, the server returns the 204 HTTP status code. Returns HTTP 404 if the group is not found (for more information, see Error handling).
Response example
No response body.
Rename keyword group
PUT https://api4.seranking.com/keyword-groups/{group_id}
Renames the specified keyword group.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| group_id | Integer | Yes | Keyword group ID (path parameter). |
| name | String | Yes | New keyword group name. |
Request example
PUT https://api4.seranking.com/keyword-groups/123
{ "name": "Updated Group Name" }Response parameters
If successful, the server returns the 204 HTTP status code. Returns HTTP 400 if no name is specified and HTTP 404 if the group is not found (for more information, see Error handling).
Response example
No response body.
Delete keyword group
DELETE https://api4.seranking.com/keyword-groups/{group_id}
Deletes the specified keyword group.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| group_id | Integer | Yes | Keyword group ID (path parameter). |
Request example
DELETE https://api4.seranking.com/keyword-groups/123Response parameters
If successful, the server returns the 204 HTTP status code. Returns HTTP 404 if the group is not found (for more information, see Error handling).
Response example
No response body.
List keyword groups
GET https://api4.seranking.com/keyword-groups/{site_id}
Returns a list of keyword groups for the specified project.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| site_id | Integer | Yes | Project (site) ID (path parameter). |
Request example
GET https://api4.seranking.com/keyword-groups/1Response parameters
If successful, the server returns the 200 HTTP status code and an array of keyword groups. Returns HTTP 404 if the site is not found (for more information, see Error handling).
| Parameter | Type | Description |
|---|---|---|
| id | String | Keyword group ID. |
| name | String | Keyword group name. |
| creation_date | String | Date the keyword group was created (in YYYY-MM-DD). |
Response example
[
{
"id": "123",
"name": "NewKeyGroup",
"creation_date": "2018-08-27"
},
{
"id": "456",
"name": "NewKeyGroup1",
"creation_date": "2018-08-27"
},
{
"id": "789",
"name": "NewKeyGroup2",
"creation_date": "2018-08-27"
}
]