SEMrush API

Бесплатный аудит вашего сайта
Incorrect email or url. Try again.
We're now auditing your website.
Your Site Audit report will be sent to your email within an hour.
You can audit another site

SEMrush API v4.0

Версия Semrush API v4.0 предназначается для приложений, зарегистрированных в Сервисе аутентификации Semrush (Google Data Studio, Zapier, etc.)

Если вы хотите воспользоваться этим API, свяжитесь с нами.

Конечная точка (Endpoints)

https://api.Semrush.com/apis/v4/

Формат ответа

В формулировке response body содержится JASON-объект, имеющий top-level object meta, за которым следует или объект данных (data object) или объект ошибки (error object), но не оба сразу. Ниже приводится объяснение каждого из этих атрибутов.

Object meta

Key

Type

Description

Optional

success

boolean

Status of the request

Mandatory

status_code

int

HTTP status code

Mandatory

request_id

string

Unique ID of the request

Optional

Пример успешного завершения запроса

{
  "meta":{
    "success": true,
    "status_code": 200,
    "request_id": "IAD-as5656as776",
  },
  "data":[
    {
      "id": "590e",
      "kind": "dog",
      "name": "Penny"
    },
    {
      "id": "a45f",
      "kind": "cat",
      "name": "Tommy"
    }
  ]}

Error Object (Объект ошибки)

Key

Type

Description

Optional

code

int

Error code

Mandatory

message

string

Error message

Mandatory

description

string

Error description

Optional

Пример неуспешного запроса

{
  "meta":{
    "success": false,
    "status_code": 400,
    "request_id": "IAD-123ade456",
  },
  "error":{
    "code": 120200,
    "message": "This was bad",
    "description": "google.me?error=120200"
  }}

Авторизация

Введите токен авторизации в HTTP-заголовок запроса.

Authorization: Bearer ****

Аудит сайта через API

Get a list of campaigns
Price: 100 API units per request

This request allows you to get a list of Siteaudit campaigns for your account.

Request method

GET

Endpoint

https://api.semrush.com/apis/v4/siteaudit/campaigns/

Response example

{
  "data":{
    "campaigns":[
      {
        "campaign_id": 123,
        "name": "Campaign name",
        "url": "campaign.url"
      },
      {
        "campaign_id": 1234,
        "name": "Campaign2 name",
        "url": "campaign2.url"
      }
    ]
  }}
Get the campaign status
Price: 100 API units per request

This request allows you to get the status of the Siteaudit campaign by ID.

Request method

GET

Endpoint

https://api.semrush.com/apis/v4/siteaudit/campaigns/{campaign_id:[0-9]+}/status

Response example

{
  "data":{
    "campaign_id": 123,
    "status": "FINISHED"
  }}
Get a list of tasks for the Site Audit campaign
Price: Free

This request allows you to get a list of tasks for your Site Audit campaign.

Request method

GET

Endpoint

https://api.semrush.com/apis/v4/siteaudit/campaigns/{campaign_id:[0-9]+}/tasks

Response example

{
  "data":{
    "tasks":[
      {
        "id": "6133a19",
        "title": "title",
        "url": "http://example/",
        "howToFix": "howToFix",
        "comment": "comment"
      }
    ]
  }}
Get Overview Report
Price: 10000 API units per request

This request allows you to get the Site Audit Overview report.

Request method

GET

Endpoint

https://api.semrush.com/apis/v4/siteaudit/campaigns/{campaign_id:[0-9]+}/reports/overview

Response example

{
  "data":{
    "campaign_id": 12345,
    "name": "example",
    "url": "example",
    "status": "FINISHED",
    "last_audit": 1590000000000,
    "pages_crawled": 100,
    "pages_limit": 100,
    "summary":{
      "errors": 6,
      "warnings": 543,
      "notices": 114,
      "blocked": 2,
      "redirected": 3,
      "healthy": 11,
      "have_issues": 84,
      "have_issues_delta": 1,
      "errors_delta": 2,
      "warnings_delta": -13,
      "notices_delta": -81
    },
    "current_snapshot":{
      "quality":{
        "value": 76,
        "delta": 2
      },
      "thematic_scores":{
        "https":{
          "value": 99
        },
        "int_seo":{
          "value": 100
        },
        "crawlability":{
          "value": 94,
          "delta": 4
        },
        "performance":{
          "value": 98,
          "delta": -2
        },
        "linking":{
          "value": 96,
          "delta": 2
        }
      }
    }
  }}
Create а new Site Audit Campaign
Price: 100 API units per request

This request allows you to create a new project and set up a Site Audit campaign.

Request method

POST

Endpoint

https://api.semrush.com/apis/v4/siteaudit/campaigns/

Request body

{
    "name": "Example",
    "pages_limit": 1000,
    "start_crawl_url": "https://www.example.com/landing/"}

Response example

{
  "data":{
    "project_id": 123
  }}
Re-crawl a Site Audit Campaign
Price: 100 API units per request

This request allows you to start a new audit for an existing campaign.

Request method

POST

Endpoint

https://api.semrush.com/apis/v4/siteaudit/campaigns/{campaign_id:[0-9]+}/recrawl

Response example

{
  "data":{
    "campaign_id": 123,
    "status": "RUNNING"
  }}