{"openapi":"3.1.0","info":{"title":"mcpmetal.ru API","version":"1.0.0","description":"Доступ к опубликованным предложениям. Требуется ключ зарегистрированной учётной записи."},"security":[{"bearerKey":[]}],"paths":{"/api/v1/offers":{"get":{"operationId":"searchOffers","summary":"Поиск предложений","parameters":[{"name":"q","in":"query","schema":{"type":"string","maxLength":160,"description":"Текст запроса, например «Уголок 50×50×5, 6 м, 100 шт.»"}},{"name":"category","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,159}$","description":"Идентификатор вида проката, например angle или pipe"}},{"name":"location","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,159}$","description":"Идентификатор города или региона, например kazan. Вся Россия — all"}},{"name":"warehouseChoice","in":"query","schema":{"type":"string","enum":["1"],"description":"Подтвердить явно указанный location, даже если в тексте другой город"}},{"name":"metres","in":"query","schema":{"type":"string","enum":["quantity","length","ignored"],"description":"Как трактовать метраж, если он неоднозначен"}},{"name":"dimensions","in":"query","schema":{"type":"string","maxLength":120,"description":"Размер"}},{"name":"grade","in":"query","schema":{"type":"string","maxLength":120,"description":"Марка или сплав"}},{"name":"standard","in":"query","schema":{"type":"string","maxLength":120,"description":"ГОСТ или ТУ"}},{"name":"length","in":"query","schema":{"type":"string","maxLength":120,"description":"Длина заготовки"}},{"name":"material","in":"query","schema":{"type":"string","maxLength":120,"description":"Материал"}},{"name":"kind","in":"query","schema":{"type":"string","maxLength":120,"description":"Исполнение"}},{"name":"quantity","in":"query","schema":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"string","pattern":"^(?:\\d+(?:[.,]\\d+)?)?$","maxLength":24}],"description":"Количество. Дробное значение можно указать с запятой. Пустая строка снимает условие из запроса."}},{"name":"unit","in":"query","schema":{"type":"string","enum":["","т","кг","пог. м","шт."],"description":"Единица количества. Пустая строка снимает условие из запроса."}},{"name":"sort","in":"query","schema":{"type":"string","enum":["match","price"],"description":"По соответствию запросу или цене в сопоставимых группах"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":25,"default":10}}],"responses":{"200":{"description":"Выдача по заданным параметрам.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Search"}}}},"400":{"description":"Проверьте параметры запроса.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Требуется действующий ключ.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Адрес отправителя запрещён.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"414":{"description":"Слишком длинный запрос.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":0}}}},"503":{"description":"Выдача ключей пока недоступна.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/offers/{id}":{"get":{"operationId":"getOffer","summary":"Предложение и расчёт по условиям запроса","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,159}$"}},{"name":"q","in":"query","schema":{"type":"string","maxLength":160,"description":"Текст запроса, например «Уголок 50×50×5, 6 м, 100 шт.»"}},{"name":"category","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,159}$","description":"Идентификатор вида проката, например angle или pipe"}},{"name":"location","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,159}$","description":"Идентификатор города или региона, например kazan. Вся Россия — all"}},{"name":"warehouseChoice","in":"query","schema":{"type":"string","enum":["1"],"description":"Подтвердить явно указанный location, даже если в тексте другой город"}},{"name":"metres","in":"query","schema":{"type":"string","enum":["quantity","length","ignored"],"description":"Как трактовать метраж, если он неоднозначен"}},{"name":"dimensions","in":"query","schema":{"type":"string","maxLength":120,"description":"Размер"}},{"name":"grade","in":"query","schema":{"type":"string","maxLength":120,"description":"Марка или сплав"}},{"name":"standard","in":"query","schema":{"type":"string","maxLength":120,"description":"ГОСТ или ТУ"}},{"name":"length","in":"query","schema":{"type":"string","maxLength":120,"description":"Длина заготовки"}},{"name":"material","in":"query","schema":{"type":"string","maxLength":120,"description":"Материал"}},{"name":"kind","in":"query","schema":{"type":"string","maxLength":120,"description":"Исполнение"}},{"name":"quantity","in":"query","schema":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"string","pattern":"^(?:\\d+(?:[.,]\\d+)?)?$","maxLength":24}],"description":"Количество. Дробное значение можно указать с запятой. Пустая строка снимает условие из запроса."}},{"name":"unit","in":"query","schema":{"type":"string","enum":["","т","кг","пог. м","шт."],"description":"Единица количества. Пустая строка снимает условие из запроса."}}],"responses":{"200":{"description":"Предложение.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferDetail"}}}},"400":{"description":"Проверьте параметры запроса.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Требуется действующий ключ.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Адрес отправителя запрещён.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Предложение не найдено.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"414":{"description":"Слишком длинный запрос.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":0}}}},"503":{"description":"Выдача ключей пока недоступна.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/suppliers/{id}":{"get":{"operationId":"getSupplier","summary":"Поставщик и предложения склада","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,159}$"}},{"name":"warehouse","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,159}$","description":"Идентификатор склада"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":25,"default":10}}],"responses":{"200":{"description":"Поставщик и склад.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Supplier"}}}},"400":{"description":"Проверьте параметры запроса.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Требуется действующий ключ.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Адрес отправителя запрещён.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Поставщик или склад не найден.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"414":{"description":"Слишком длинный запрос.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":0}}}},"503":{"description":"Выдача ключей пока недоступна.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerKey":{"type":"http","scheme":"bearer","bearerFormat":"mcpmetal key"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"Pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":0},"nextPage":{"type":["integer","null"]}},"required":["page","limit","total","nextPage"]},"WarehouseSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"cityId":{"type":"string"},"city":{"type":"string"}},"required":["id","name","cityId","city"]},"Warehouse":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"cityId":{"type":"string"},"city":{"type":"string"},"address":{"type":["string","null"]},"delivery":{"type":["string","null"]},"phone":{"type":["string","null"]},"commonPhone":{"type":"boolean"},"email":{"type":["string","null"]}},"required":["id","name","cityId","city","address","delivery","phone","commonPhone","email"]},"Rate":{"type":"object","properties":{"amount":{"type":"number"},"unit":{"type":"string"},"min":{"type":["number","null"]},"max":{"type":["number","null"]},"basis":{"type":"string","description":"При theoretical-ton цена рассчитана на теоретическую массу."}},"required":["amount","unit"]},"Offer":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"attributes":{"type":"object","properties":{"dimensions":{"type":["string","null"]},"grade":{"type":["string","null"]},"standard":{"type":["string","null"]},"length":{"type":["string","null"]},"material":{"type":["string","null"]},"kind":{"type":["string","null"]},"coating":{"type":["string","null"]}},"required":["dimensions","grade","standard","length","material","kind","coating"]},"supplier":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string","format":"uri","description":"Полная ссылка на карточку поставщика с выбранным складом."}},"required":["id","name","url"]},"warehouse":{"$ref":"#/components/schemas/Warehouse"},"match":{"type":"string","enum":["exact","uncertain","alternatives","outside"]},"matchReason":{"type":["string","null"]},"price":{"type":"object","properties":{"currency":{"const":"RUB"},"vat":{"type":"string","enum":["included","excluded","unknown"]},"tiers":{"type":"array","items":{"$ref":"#/components/schemas/Rate"}},"chosen":{"anyOf":[{"$ref":"#/components/schemas/Rate"},{"type":"null"}]},"total":{"type":["number","null"]},"reason":{"type":["string","null"]},"requestedQuantity":{"type":["number","null"]},"requestedUnit":{"type":["string","null"]},"calculatedQuantity":{"type":["number","null"]},"calculatedUnit":{"type":["string","null"]},"conversion":{"type":["string","null"]},"comparisonGroup":{"type":["string","null"]}},"required":["currency","vat","tiers","chosen","total","reason","requestedQuantity","requestedUnit","calculatedQuantity","calculatedUnit","conversion","comparisonGroup"]},"stock":{"type":"object","properties":{"status":{"type":"string","enum":["unknown","enough","partial"]},"availability":{"type":"string","enum":["unknown","stock","order","none"]},"available":{"type":["number","null"]},"requested":{"type":["number","null"]},"unit":{"type":"string"},"reportedQuantity":{"type":["string","null"]}},"required":["status","availability","available","requested","unit","reportedQuantity"]},"provenance":{"type":"object","properties":{"label":{"type":["string","null"]},"url":{"type":["string","null"]},"priceDate":{"type":["string","null"]},"stockDate":{"type":["string","null"]},"importedAt":{"type":["string","null"]},"stalePrice":{"type":"boolean"},"staleStock":{"type":"boolean"}},"required":["label","url","priceDate","stockDate","importedAt","stalePrice","staleStock"]},"href":{"type":"string","description":"Путь к карточке предложения на сайте."},"url":{"type":"string","format":"uri","description":"Полная ссылка на карточку предложения."}},"required":["id","title","category","attributes","supplier","warehouse","match","matchReason","price","stock","provenance","href","url"]},"Search":{"type":"object","properties":{"demo":{"type":"boolean"},"applied":{"type":"object","properties":{"q":{"type":"string"},"category":{"type":"string"},"location":{"type":"string"},"locationName":{"type":"string"},"filters":{"type":"object","additionalProperties":{"type":"string"}},"requirements":{"type":"object","properties":{"delivery":{"type":"string"},"coating":{"type":"string"}},"required":["delivery","coating"]},"ambiguousMetres":{"type":"string"},"locationConflict":{"type":"boolean"},"notice":{"type":"string"},"metreChoice":{"type":"string"},"sort":{"type":"string"}},"required":["q","category","location","locationName","filters","requirements","ambiguousMetres","locationConflict","notice","metreChoice","sort"]},"coverage":{"type":"boolean"},"counts":{"type":"object","properties":{"exact":{"type":"integer","minimum":0},"uncertain":{"type":"integer","minimum":0},"alternatives":{"type":"integer","minimum":0}},"required":["exact","uncertain","alternatives"]},"offers":{"type":"array","items":{"$ref":"#/components/schemas/Offer"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["demo","applied","coverage","counts","offers","pagination"]},"OfferDetail":{"type":"object","properties":{"demo":{"type":"boolean"},"offer":{"$ref":"#/components/schemas/Offer"}},"required":["demo","offer"]},"Supplier":{"type":"object","properties":{"demo":{"type":"boolean"},"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string","format":"uri","description":"Полная ссылка на карточку поставщика с выбранным складом."},"warehouse":{"$ref":"#/components/schemas/Warehouse"},"warehouses":{"type":"array","items":{"$ref":"#/components/schemas/WarehouseSummary"}},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"priceDate":{"type":["string","null"]},"stalePrice":{"type":"boolean"},"href":{"type":"string"},"url":{"type":"string","format":"uri","description":"Полная ссылка на карточку предложения."}},"required":["id","title","priceDate","stalePrice","href","url"]}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["demo","id","name","url","warehouse","warehouses","offers","pagination"]}}}}