Table of content
Keyword groups API
Creating a group of keywords
The method allows to add a group for project keywords.
Parameters
Name | Required | Description |
name | Yes | Name of the project keyword group to be added |
site_id | Yes | ID of the project to which a keyword group will be added |
Request format
POST https://api4.seranking.com/keyword-groups
{
“name”: “groupname”,
“site_id”: 1
}
Result
If successful, the server returns the 201 HTTP code and an array containing the ID of the added project keyword group.
Name | Required | Description |
group_id | Yes | ID of the added project keyword group |
Response example
{
“group_id”: 123456
}
Errors
HTTP code | Error message |
404 | Empty name |
404 | Empty site_id |
Moving keywords to another group
The method allows to transfer project keywords from one group to another.
Parameters
Name | Required | Description |
keyword_ids | Yes | Array of the IDs of keywords to be transferred |
Request format
POST /keyword-groups/{group_id}/keywords
{
“keywords_ids”: [1,2,3,4,5]
}
Result
If successful, the server returns the 204 HTTP code.
Errors
HTTP code | Error message |
404 | Group not found |
Renaming a keyword group
The method allows to change the name of a project keyword group.
Parameters
Name | Required | Description |
name | Yes | New keyword group name |
Request format
PUT /keyword-groups/{group_id}
{
“name”: “new name”
}
Result
If successful, the server returns the 204 HTTP code.
Errors
HTTP code | Error message |
404 | Empty name |
404 | Group not found |
Deleting a keyword group
The method allows to delete a project keyword group.
Request format
DELETE /keyword-groups/{group_id}
Result
If successful, the server returns the 204 HTTP code.
Errors
HTTP code | Error message |
404 | Group not found |
Getting a list of keyword groups
The method allows to get a list of keyword groups for a specified project.
Request format
GET /keyword-groups/{site_id}
Result
If successful, the server returns an array of keyword groups for the specified project.
Name | Required | Description |
name | Yes | Project keyword group name |
id | Yes | Project keyword group ID |
creation_date | Yes | Date of creation of a project keyword group |
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”
}
]
Errors
HTTP code | Error message |
404 | No keywords ids in request |
404 | Group not found |