URL Tags
URL Tags API provides endpoints to manage landing page tags within a site.
List tags
GET https://api4.seranking.com/sites/{site_id}/url-tags
Returns a list of landing page tags added to domains and/or links within the specified site.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| site_id | Integer | Yes | Website ID (path parameter). |
Request example
GET https://api4.seranking.com/sites/1/url-tagsResponse parameters
If successful, the server returns the 200 HTTP status code and an array of tags.
| Parameter | Type | Description |
|---|---|---|
| id | String | Tag ID. |
| name | String | Tag name. |
| url | Array | List of links the tag is added to. |
| domain | Array | List of domains the tag is added to. |
Response example
[
{
"id": "51",
"name": "tag1",
"url": [ "https://test.com" ],
"domain": [ "www.flotenk.com", "google.com" ]
},
...
]Add tag
POST https://api4.seranking.com/sites/{site_id}/url-tags
Creates a tag within the specified site and optionally attaches it to links and/or domains. You can add a maximum of 20 tags to one site.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| site_id | Integer | Yes | Website ID (path parameter). |
| name | String | Yes | Tag name. |
| urls | Array | No | List of links the tag is added to. |
| domains | Array | No | List of domains the tag is added to. |
Request example
POST https://api4.seranking.com/sites/1/url-tags
{
"name": "tag1",
"urls": ["http://url.com/path"],
"domains": ["test.com"]
}Response parameters
If successful, the server returns the 200 HTTP status code and the created tag ID. Returns HTTP 400 if the maximum number of tags per site is exceeded (for more information, see Error handling).
| Parameter | Type | Description |
|---|---|---|
| tag_id | Integer | Created tag ID. |
Response example
{ "tag_id": 1 }Update tag assignment
PUT https://api4.seranking.com/sites/{site_id}/url-tags
Assigns tags to the specified links and/or domains. All previously assigned tags for the submitted links and domains are removed and replaced with the provided tag IDs.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| site_id | Integer | Yes | Website ID (path parameter). |
| tag_ids | Array | Yes | List of tag IDs to assign. |
| urls | Array | No | List of links to update. |
| domains | Array | No | List of domains to update. |
Request example
PUT https://api4.seranking.com/sites/1/url-tags
{
"tag_ids": [1, 2],
"urls": ["http://url.com/path"],
"domains": ["test.com"]
}Response parameters
If successful, the server returns the 204 HTTP status code. Returns HTTP 404 if one or more tags are not found (for more information, see Error handling).
Response example
No response body.
Delete tag
DELETE https://api4.seranking.com/sites/{site_id}/url-tags/{tag_id}
Deletes a tag from the specified site.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| site_id | Integer | Yes | Website ID (path parameter). |
| tag_id | Integer | Yes | Tag ID (path parameter). |
Request example
DELETE https://api4.seranking.com/sites/1/url-tags/51Response parameters
If successful, the server returns the 204 HTTP status code. Returns HTTP 404 if the tag is not found (for more information, see Error handling).
Response example
No response body.
