Use your Black Friday discount until December 4thLearn more

Keyword groups API

Creating a group of keywords

The method allows to add a group for project keywords.

Parameters

NameRequiredDescription
nameYes Name of the project keyword group to be added
site_idYes 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.

NameRequiredDescription
group_idYes ID of the added project keyword group

Response example


{
“group_id”: 123456
}

Errors

HTTP codeError message
404Empty name
404Empty site_id

Moving keywords to another group

The method allows to transfer project keywords from one group to another.

Parameters

NameRequiredDescription
keyword_idsYes 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 codeError message
404 Group not found

Renaming a keyword group

The method allows to change the name of a project keyword group.

Parameters

NameRequiredDescription
nameYes 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 codeError message
404Empty name
404Group 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 codeError 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.

NameRequiredDescription
nameYes Project keyword group name
idYes Project keyword group ID
creation_dateYes 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 codeError message
404 No keywords ids in request
404 Group not found