{
  "openapi": "3.1.0",
  "info": {
    "title": "Smart Ranking Data API",
    "version": "1.0.0",
    "description": "REST API данных Smart Ranking для подписчиков Smart Ranking Data: рейтинги российских технологических компаний, выручка, материалы «Новости и тренды». Авторизация — API-ключ из личного кабинета (Authorization: Bearer sr_live_…). Лимиты: 200 запросов в календарные сутки по Москве и 20 в минуту на аккаунт, не больше 100 строк в ответе. Те же функции доступны через MCP: https://smartranking.ru/mcp/. Документация: https://smartranking.ru/ru/data/api/"
  },
  "servers": [
    {
      "url": "https://smartranking.ru"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/api/v1/companies/search": {
      "get": {
        "operationId": "search_companies",
        "summary": "Поиск компаний",
        "description": "Нечеткий поиск компаний Smart Ranking: русское или английское название, бренд, любой регистр, транслитерация (Скиллбокс = Skillbox), опечатки, точный поиск по ИНН (сам ИНН в ответ не попадает). Возвращает slug для get_company. score: 100 — точное совпадение названия, 90 — другое написание или алиас целиком, 60-80 — начало названия, ниже — частичное совпадение или опечатка.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Название, бренд или ИНН (от 2 символов). Синоним: q"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Тот же JSON, что MCP возвращает в structuredContent",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/v1/companies/{company}": {
      "get": {
        "operationId": "get_company",
        "summary": "Карточка компании",
        "description": "Карточка компании: описание, сайт, год основания, бренды, CEO и команда, сегмент, выручка по периодам (revenue) и места во всех рейтингах, где компания есть (отраслевые, BigTech 100, PR-100, Smart 500). company — slug или название (при неоднозначности вернется список кандидатов). periods — фильтр периодов (\"2025\", \"2026-Q2\"); без него: вся выручка, свежий период отраслевых рейтингов и все издания BigTech / PR-100 / Smart 500. Выручка в рублях (целое число). is_estimate=true — оценка Smart Ranking, false — данные компании или ФНС. source_url — ссылка на источник (ФНС), если есть.",
        "parameters": [
          {
            "name": "company",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "slug или название компании"
          },
          {
            "name": "periods",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 20
            },
            "style": "form",
            "explode": false,
            "description": "Периоды: \"2025\", \"2026-Q2\", \"2023-H1\". Несколько значений — через запятую"
          }
        ],
        "responses": {
          "200": {
            "description": "Тот же JSON, что MCP возвращает в structuredContent",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/v1/ratings": {
      "get": {
        "operationId": "list_ratings",
        "summary": "Список рейтингов",
        "description": "Все рейтинги Smart Ranking: отраслевые рынки (EdTech, MedTech, FinTech, HRTech, AI, PropTech и др.), BigTech 100, PR-100, Smart 500. Для каждого: rating_slug, доступные периоды (передавать в get_rating как period), период по умолчанию, число компаний, дата последней синхронизации данных (synced_at). kind: market | bigtech | pr100 | smart500.",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "market",
                "bigtech",
                "pr100",
                "smart500"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Тот же JSON, что MCP возвращает в structuredContent",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/v1/ratings/{rating}": {
      "get": {
        "operationId": "get_rating",
        "summary": "Таблица рейтинга",
        "description": "Строки рейтинга за период — те же места и цифры, что на странице рейтинга сайта. rating: slug или название (\"edtech\", \"MedTech\", \"медтех\", \"BigTech 2025\"). period обязателен (см. list_ratings; без него или с неверным — ошибка со списком available_periods). Фильтры: rank_from/rank_to, top_n (места 1..N), segment. Сортировка sort_by rank|revenue|growth, order asc|desc. rank — всегда место в рейтинге за период, position — номер в текущей выдаче. compared_to — период сравнения (для периода по умолчанию — как на сайте, иначе тот же период годом ранее), growth_pct — рост к нему. Рейтинг и места считаются только по выручке: компании, у которых за период есть только GMV, в рейтинг не входят (как на сайте). Не больше 100 строк за раз, дальше offset. В каждом ответе summary по выбранному срезу (без учета limit/offset) и summary_all по всему рейтингу периода: companies_count, total_revenue, total_prev_revenue, total_growth_pct (рост суммарной выручки компаний, у которых есть оба периода — growth_base_count), median_growth_pct, estimates_count. Общая выручка топ-50: top_n=50, summary_only=true. Для Smart 500 period — год издания: выручка за (period-3) и (period-1), рост за два года, score — итоговый балл; data_period — за какой период выручка в строках. Выручка в рублях (целое число). is_estimate=true — оценка Smart Ranking, false — данные компании или ФНС. source_url — ссылка на источник (ФНС), если есть.",
        "parameters": [
          {
            "name": "rating",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "slug или название рейтинга"
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "2025, 2025-H1, 2025-Q4, 2025-M03"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "rank",
                "revenue",
                "growth"
              ],
              "default": "rank"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "rank_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "rank_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "top_n",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "segment",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "summary_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Тот же JSON, что MCP возвращает в structuredContent",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/v1/analytics/search": {
      "get": {
        "operationId": "search_analytics",
        "summary": "Поиск по материалам",
        "description": "Поиск по опубликованным бесплатным материалам «Новости и тренды» Smart Ranking: заголовок, рынок, дата, короткий фрагмент и ссылка. Платные отчеты — только название и ссылка (paid_reports), тексты не отдаются. market — рынок (\"fintech\", \"MedTech\"). Нужен query или market; пустой query с market — свежие материалы рынка.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Синоним: q"
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Тот же JSON, что MCP возвращает в structuredContent",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "API-ключ sr_live_… из личного кабинета, вкладка «API и MCP»"
      }
    },
    "headers": {
      "X-RateLimit-Limit": {
        "schema": {
          "type": "integer"
        },
        "description": "Лимит запросов в сутки"
      },
      "X-RateLimit-Remaining": {
        "schema": {
          "type": "integer"
        },
        "description": "Осталось запросов до сброса"
      },
      "X-RateLimit-Reset": {
        "schema": {
          "type": "integer"
        },
        "description": "Unix-время сброса (00:00 МСК)"
      }
    },
    "responses": {
      "Problem": {
        "description": "Ошибка в формате RFC 9457",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "status",
          "detail"
        ]
      }
    }
  }
}