SERM, специалисты и сценарии API
SERM, специалисты и сценарии API. HTTP-запросы, параметры, схемы ответов и порядок работы с Labrika.
В этой статье
Справочник методов API — SERM
Выберите метод в оглавлении. Проверьте его HTTP-метод, путь, права доступа, обязательные параметры и тело запроса. JSON-блоки со словами schema, properties и $ref описывают контракт; их не нужно отправлять как готовое тело запроса. Примеры запросов и схемы ответов подписаны отдельно.
Методы в этом разделе
POST /public-api/v1/serm/sites/{site_uuid}/cost
Спросить глубину поиска (20, 50, 100 или 200 результатов), затем показать цену SERM для этой глубины.
Связанные модели данных: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · AnalysisEstimate · ErrorResponse
Права доступа: serm:run
Параметры
site_uuid (path)
{
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-f]{32}$",
"example": "d3c9e51b06a44e27831f205ceac20000"
}
}
Запрос
{
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"depth"
],
"properties": {
"depth": {
"type": "integer",
"enum": [
20,
50,
100,
200
]
}
}
}
}
}
}
Ответы
200
Спросить глубину поиска (20, 50, 100 или 200 результатов), затем показать цену SERM для этой глубины.
{
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/AnalysisEstimate"
}
}
}
}
}
}
400
Для отсутствующего или неверного ключа заголовки лимита относятся к неудачным попыткам с IP. После авторизации они описывают применимый лимит ключа или аккаунта. При блокировке до проверки лимита или недоступности счётчика заголовки могут отсутствовать. X-RateLimit-Reset — Unix timestamp в секундах; Retry-After при 429 — задержка в секундах.
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
401
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
403
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
404
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
409
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
422
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
429
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
POST /public-api/v1/serm/sites/{site_uuid}/run
Запустить анализ по согласованной цене с идентификатором расчёта и его Idempotency-Key.
Связанные модели данных: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · ErrorResponse
Права доступа: serm:run
Параметры
site_uuid (path)
{
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-f]{32}$",
"example": "d3c9e51b06a44e27831f205ceac20000"
}
}
Idempotency-Key (header)
{
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 255
}
}
Запрос
{
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"cost_estimate_id"
],
"properties": {
"cost_estimate_id": {
"type": "string"
}
}
}
}
}
}
Ответы
202
Запустить анализ по согласованной цене с идентификатором расчёта и его Idempotency-Key.
{
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
400
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
401
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
403
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
404
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
409
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
422
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
429
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
GET /public-api/v1/serm/sites/{site_uuid}/report
Получите последний опубликованный отчёт SERM или выберите снимок по report_id. В ответе приходят дата отчёта, язык, статус и разделы, к которым у вас есть доступ.
Связанные модели данных: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · ErrorResponse
Права доступа: serm:read
Параметры
site_uuid (path)
{
"required": true,
"schema": {
"type": "string",
"pattern": "^[a-f0-9]{32}$",
"example": "d3c9e51b06a44e27831f205ceac20000"
}
}
report_id (query)
{
"schema": {
"type": "string",
"pattern": "^[0-9a-v]{20}$"
}
}
Ответы
200
Получите последний опубликованный отчёт SERM или выберите снимок по report_id. В ответе приходят дата отчёта, язык, статус и разделы, к которым у вас есть доступ.
{
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"required": [
"site_uuid",
"report_id",
"created_at",
"language",
"status",
"sections"
],
"properties": {
"site_uuid": {
"type": "string"
},
"report_id": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"language": {
"type": "string"
},
"status": {
"type": "string"
},
"sections": {
"type": "array",
"items": {
"type": "object",
"required": [
"section",
"report_id",
"status",
"calculated_at",
"data"
],
"properties": {
"section": {
"type": "string"
},
"report_id": {
"type": "string"
},
"status": {
"type": "string"
},
"calculated_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"data": {
"type": "object",
"nullable": true,
"properties": {
"version": {
"type": "integer"
},
"total": {
"type": "integer"
},
"known": {
"type": "integer"
},
"unknown": {
"type": "integer"
},
"positive": {
"type": "integer"
},
"neutral": {
"type": "integer"
},
"negative": {
"type": "integer"
},
"average": {
"type": "number",
"nullable": true
},
"negative_share": {
"type": "number",
"nullable": true
},
"metrics": {
"type": "array",
"nullable": true,
"items": {
"type": "object"
}
},
"groups": {
"type": "array",
"nullable": true,
"items": {
"type": "object"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
400
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
401
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
403
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
404
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
409
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
422
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
429
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
Справочник методов API — Specialists
Выберите метод в оглавлении. Проверьте его HTTP-метод, путь, права доступа, обязательные параметры и тело запроса. JSON-блоки со словами schema, properties и $ref описывают контракт; их не нужно отправлять как готовое тело запроса. Примеры запросов и схемы ответов подписаны отдельно.
Методы в этом разделе
POST /public-api/v1/specialist-requests
Отправить запрос на поиск специалиста на модерацию. Укажите контактный email, уже подтверждённый в «Специалистах», и примите действующие правила заказчика.
Связанные модели данных: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · ErrorResponse
Права доступа: specialist-requests:write
Параметры
Idempotency-Key (header)
{
"required": true,
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9._:-]+$"
}
}
Запрос
{
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"title",
"description",
"category",
"language",
"email",
"currency",
"budget_type",
"payment_methods",
"rules_version",
"accept_terms"
],
"oneOf": [
{
"properties": {
"budget_type": {
"enum": [
"fixed",
"approximate"
]
}
},
"required": [
"budget_minor"
]
},
{
"properties": {
"budget_type": {
"enum": [
"negotiable"
]
}
},
"not": {
"required": [
"budget_minor"
]
}
}
],
"properties": {
"title": {
"type": "string",
"minLength": 5,
"maxLength": 200
},
"description": {
"type": "string",
"minLength": 100,
"maxLength": 5000
},
"category": {
"type": "string",
"enum": [
"technical",
"seo",
"content",
"speed",
"analytics",
"reputation",
"directory_registration",
"crowd_links",
"text_optimization",
"contextual_ads",
"website_development",
"website_modernization",
"outreach"
],
"example": "seo"
},
"language": {
"type": "string",
"example": "en"
},
"email": {
"type": "string",
"format": "email"
},
"currency": {
"type": "string",
"example": "USD"
},
"budget_type": {
"type": "string",
"enum": [
"fixed",
"approximate",
"negotiable"
]
},
"budget_minor": {
"type": "integer",
"format": "int64",
"minimum": 1,
"maximum": 10000000000
},
"payment_methods": {
"type": "array",
"items": {
"type": "string",
"enum": [
"bank_transfer",
"card_transfer",
"sbp",
"yoomoney",
"card_payment",
"paypal",
"swift",
"bank_transfer_individual",
"bank_transfer_business"
]
}
},
"rules_version": {
"type": "integer",
"example": 2
},
"accept_terms": {
"type": "boolean",
"enum": [
true
]
}
}
}
}
}
}
Ответы
201
Запрос отправлен на модерацию.
{
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"required": [
"id",
"status"
],
"properties": {
"id": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"pending_moderation"
]
}
}
}
}
}
}
}
}
400
Для отсутствующего или неверного ключа заголовки лимита относятся к неудачным попыткам с IP. После авторизации они описывают применимый лимит ключа или аккаунта. При блокировке до проверки лимита или недоступности счётчика заголовки могут отсутствовать. X-RateLimit-Reset — Unix timestamp в секундах; Retry-After при 429 — задержка в секундах.
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
401
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
403
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
409
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
429
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
Сценарии работы
Начните с результата, который нужен, и пройдите цепочку запросов. Права указаны для каждого сценария.
Задайте LABRIKA_API_KEY. SITE_UUID и ENGINE_ID возьмите из списка сайтов, PROJECT_ID — из списка проектов. Задайте COST_ESTIMATE_ID и IDEMPOTENCY_KEY по полям cost_estimate_id и idempotency_key из расчёта. RUN_ID возьмите из ответа запуска. Задайте LIST_REVISION по полю list.revision из результата. После правки списка обновите LIST_REVISION по полю revision из ответа PATCH перед переносом.
При тайм-ауте запуска повторите запрос с тем же Idempotency-Key и телом. При 401 проверьте ключ, при 403 — права. При 409 прочитайте причину конфликта. При 429 учитывайте Retry-After, если сервер его вернул.
Последние позиции
Получите сохранённые позиции по нужному региону и поисковой системе.
serp:read
Для чтения позиций нужна активная подписка Business или Agency. Списки сайтов и дат замеров доступны с правом serp:read.
GET
/serp/sites?limit=10curl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/serp/sites?limit=10" \ -H "Authorization: Bearer $LABRIKA_API_KEY"GET
/serp/sites/$SITE_UUID/search-engines/$ENGINE_ID/dates?limit=5curl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/serp/sites/$SITE_UUID/search-engines/$ENGINE_ID/dates?limit=5" \ -H "Authorization: Bearer $LABRIKA_API_KEY"GET
/serp/sites/$SITE_UUID/search-engines/$ENGINE_ID/positions?collected_at=last&limit=20curl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/serp/sites/$SITE_UUID/search-engines/$ENGINE_ID/positions?collected_at=last&limit=20" \ -H "Authorization: Bearer $LABRIKA_API_KEY"
{
"data": [
{
"site_uuid": "d3c9e51b06a44e27831f205ceac20000",
"host": "example.com",
"search_engines": [
{
"id": 42,
"engine_title": "Google"
}
]
}
]
}
Запуск полного анализа
Сохраните идентификатор расчёта и проверьте стадию запуска по идентификатору сайта.
site-audits:runmain-reports:read
GET
/main-reports/sites?limit=10curl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/main-reports/sites?limit=10" \ -H "Authorization: Bearer $LABRIKA_API_KEY"POST
/site-audits/sites/$SITE_UUID/costcurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/site-audits/sites/$SITE_UUID/cost" \ -H "Authorization: Bearer $LABRIKA_API_KEY" \ -H "Content-Type: application/json" \ --data '{"pages_limit":500,"payment_option":"auto"}'POST
/site-audits/sites/$SITE_UUID/runcurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/site-audits/sites/$SITE_UUID/run" \ -H "Authorization: Bearer $LABRIKA_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $IDEMPOTENCY_KEY" \ --data-binary @- <<JSON {"cost_estimate_id":"${COST_ESTIMATE_ID:?}"} JSONGET
/site-audits/sites/$SITE_UUID/progresscurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/site-audits/sites/$SITE_UUID/progress" \ -H "Authorization: Bearer $LABRIKA_API_KEY"
{
"data": {
"cost_estimate_id": "ESTIMATE_FROM_COST",
"idempotency_key": "KEY_FROM_COST",
"page_credits": 500,
"amount_minor": 0
}
}
Ключевые фразы для сайта
Получите результат, поправьте рабочий список и перенесите выбранную ревизию в настройки сайта.
domain-keywords:run
По ответу расчёта задайте PAYMENT_OPTION. Используйте ai_credits, если credits_available равно true, или money_balance, если balance_available равно true. Если оба значения false, пополните баланс перед запуском. При повторе запуска используйте тот же способ оплаты.
POST
/domain-keywords/costcurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/domain-keywords/cost" \ -H "Authorization: Bearer $LABRIKA_API_KEY" \ -H "Content-Type: application/json" \ --data '{"domain":"example.com","keyword_count":80}'POST
/domain-keywords/runcurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/domain-keywords/run" \ -H "Authorization: Bearer $LABRIKA_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $IDEMPOTENCY_KEY" \ --data-binary @- <<JSON {"cost_estimate_id":"${COST_ESTIMATE_ID:?}","payment_option":"${PAYMENT_OPTION:?}"} JSONGET
/domain-keywords/runs/$RUN_ID/progresscurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/domain-keywords/runs/$RUN_ID/progress" \ -H "Authorization: Bearer $LABRIKA_API_KEY"GET
/domain-keywords/runs/$RUN_IDcurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/domain-keywords/runs/$RUN_ID" \ -H "Authorization: Bearer $LABRIKA_API_KEY"PATCH
/domain-keywords/runs/$RUN_ID/listcurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/domain-keywords/runs/$RUN_ID/list" \ -H "Authorization: Bearer $LABRIKA_API_KEY" \ -H "Content-Type: application/json" \ -X PATCH \ --data-binary @- <<JSON {"revision":${LIST_REVISION:?},"mode":"append","items":[{"text":"wholesale tea"}]} JSONPOST
/domain-keywords/runs/$RUN_ID/applycurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/domain-keywords/runs/$RUN_ID/apply" \ -H "Authorization: Bearer $LABRIKA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<JSON {"site_uuid":"${SITE_UUID:?}","revision":${LIST_REVISION:?}} JSON
{
"cost_estimate_id": "ESTIMATE_FROM_COST",
"idempotency_key": "KEY_FROM_COST",
"ai_credits": 40,
"amount_minor": 20,
"currency": "USD",
"credits_available": true,
"balance_available": true,
"keyword_count": 80
}
Промпты для «Видимости в ИИ»
Укажите, что компания предлагает и чем точно не занимается. Доступно 30–2000 промптов с шагом 10.
prompt-suggestions:run
По ответу расчёта задайте PAYMENT_OPTION. Используйте ai_credits, если credits_available равно true, или money_balance, если balance_available равно true. Если оба значения false, пополните баланс перед запуском. При повторе запуска используйте тот же способ оплаты.
POST
/prompt-suggestions/costcurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/prompt-suggestions/cost" \ -H "Authorization: Bearer $LABRIKA_API_KEY" \ -H "Content-Type: application/json" \ --data '{"domain":"example.com","company_description":"We supply wholesale loose-leaf tea and tasting packs to cafés and independent retailers. We help customers plan their range and deliver regularly under contract.","exclusions":["Coffee","Coffee equipment","Retail purchases"],"prompt_count":30}'POST
/prompt-suggestions/runcurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/prompt-suggestions/run" \ -H "Authorization: Bearer $LABRIKA_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $IDEMPOTENCY_KEY" \ --data-binary @- <<JSON {"cost_estimate_id":"${COST_ESTIMATE_ID:?}","payment_option":"${PAYMENT_OPTION:?}"} JSONGET
/prompt-suggestions/runs/$RUN_ID/progresscurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/prompt-suggestions/runs/$RUN_ID/progress" \ -H "Authorization: Bearer $LABRIKA_API_KEY"GET
/prompt-suggestions/runs/$RUN_IDcurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/prompt-suggestions/runs/$RUN_ID" \ -H "Authorization: Bearer $LABRIKA_API_KEY"PATCH
/prompt-suggestions/runs/$RUN_ID/listcurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/prompt-suggestions/runs/$RUN_ID/list" \ -H "Authorization: Bearer $LABRIKA_API_KEY" \ -H "Content-Type: application/json" \ -X PATCH \ --data-binary @- <<JSON {"revision":${LIST_REVISION:?},"mode":"append","items":[{"text":"Where can cafés buy wholesale tea?"}]} JSONPOST
/prompt-suggestions/runs/$RUN_ID/applycurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/prompt-suggestions/runs/$RUN_ID/apply" \ -H "Authorization: Bearer $LABRIKA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<JSON {"site_uuid":"${SITE_UUID:?}","revision":${LIST_REVISION:?}} JSON
{
"cost_estimate_id": "ESTIMATE_FROM_COST",
"idempotency_key": "KEY_FROM_COST",
"ai_credits": 21,
"amount_minor": 11,
"currency": "USD",
"credits_available": true,
"balance_available": true
}
Видимость в ИИ
Найдите проекты по домену, чтобы выбрать существующий проект или создать ещё один. Запустите «Видимость в ИИ» по согласованной цене. Используйте Idempotency-Key из расчёта. При подтверждении новые настройки заменяют настройки отчёта в проекте.
sites:createai-visibility:run
Рассчитайте цену «Видимости в ИИ» по сохранённым или новым настройкам. Чтобы увидеть цену в лимитах ИИ и валюте аккаунта, не передавайте payment_option. На этом шаге отчёт не запускается.
GET
/sites/by-domain?domain=example.comcurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/sites/by-domain?domain=example.com" \ -H "Authorization: Bearer $LABRIKA_API_KEY"GET
/ai-visibility/sites/$SITE_UUID/modelscurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/ai-visibility/sites/$SITE_UUID/models" \ -H "Authorization: Bearer $LABRIKA_API_KEY"POST
/ai-visibility/sites/$SITE_UUID/costcurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/ai-visibility/sites/$SITE_UUID/cost" \ -H "Authorization: Bearer $LABRIKA_API_KEY" \ -H "Content-Type: application/json" \ --data '{"settings":{"domain":"example.com","brand":"Acme","aliases":["Acme Studio"],"prompts":["Where can cafés order tea wholesale?"],"models":["chatgpt"],"competitors":[{"domain":"competitor.example","brand":"Rival Tea"}]}}'POST
/ai-visibility/sites/$SITE_UUID/runcurl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/ai-visibility/sites/$SITE_UUID/run" \ -H "Authorization: Bearer $LABRIKA_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $IDEMPOTENCY_KEY" \ --data-binary @- <<JSON {"cost_estimate_id":"${COST_ESTIMATE_ID:?}"} JSON
{
"data": {
"cost_estimate_id": "ESTIMATE_FROM_COST",
"idempotency_key": "KEY_FROM_COST",
"ai_credits": 1,
"money_equivalent_minor": 1,
"can_start": true
}
}
Изменения на сайте
Найдите проект мониторинга и прочитайте его последние уведомления.
diff-projects:readdiff-alerts:read
GET
/diff-projects?limit=10curl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/diff-projects?limit=10" \ -H "Authorization: Bearer $LABRIKA_API_KEY"GET
/diff-projects/$PROJECT_ID/alerts?limit=20curl --silent --show-error --fail-with-body "https://app.labrika.ru/public-api/v1/diff-projects/$PROJECT_ID/alerts?limit=20" \ -H "Authorization: Bearer $LABRIKA_API_KEY"
HTTP 202 означает, что запрос принят, а не что работа завершена. Сохраните выданный идентификатор и проверяйте состояние указанным GET-методом. HTTP 200 при чтении состояния тоже не означает успеха самой задачи: смотрите status и поля ошибки. Если ответ содержит retry_after_seconds, выдержите этот интервал.
Баллы общего бюджета API/MCP, деньги на счёте, лимиты подписки и ИИ-кредиты — разные ресурсы. Отсутствие списания денег при оценке стоимости не означает, что запрос не расходует технический бюджет. Перед платной операцией сверяйте актуальный расчёт, способ оплаты и валюту ответа.
Другие статьи раздела
- Быстрый старт, авторизация и ошибки API Labrika
- Модели данных и служебные методы API Labrika
- SEO-аудит, отчёты и экспорт через API
- Ключевые слова и позиции через API
- ИИ-видимость и подбор промптов через API
- ИИ-писатель и описания товаров через API
- Мониторинг изменений Diff через API
- Оповещения, webhooks и расписания API
- Планы работ, задачи и группы проектов API