0
Fixed

При запросе с count=1 пустой ответ

Alexey Lyubimov 2 years ago in Подсказки • updated by grim.cap 2 years ago 4

Следуем вашей рекомендации (https://dadata.userecho.com/topics/2340-pri-zaprose-s-count1-pustoj-otvet/) и передаем во второй запрос значение unrestricted_value. Для части адресов получаем аналогичную проблему.

Пример:

Запрос 1. С count=7 для некоторого адреса.

curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Token ****key****" -d "{ \"count\": 7, \"query\": \" г Москва, ул Бобруйская, д 34, кв 25\" }" https://dadata.ru/api/v2/suggest/address
{"suggestions":[{"value":"г Москва, ул Бобруйская, д 34, кв 25","unrestricted_value":"г Москва, р-н Кунцево, ул Бобруйская, д 34, кв 25","data":{"postal_code":"121359","country":"Россия","region_fias_id":"0c5b2444-70a0-4932-980c-b4dc0d3f02b5","region_kladr_id":"7700000000000","region_with_type":"г Москва","region_type":"г","region_type_full":"город","region":"Москва","area_fias_id":null,"area_kladr_id":null,"area_with_type":null,"area_type":null,"area_type_full":null,"area":null,"city_fias_id":"0c5b2444-70a0-4932-980c-b4dc0d3f02b5","city_kladr_id":"7700000000000","city_with_type":"г Москва","city_type":"г","city_type_full":"город","city":"Москва","city_area":"Западный","city_district_fias_id":null,"city_district_kladr_id":null,"city_district_with_type":"р-н Кунцево","city_district_type":"р-н","city_district_type_full":"район","city_district":"Кунцево","settlement_fias_id":null,"settlement_kladr_id":null,"settlement_with_type":null,"settlement_type":null,"settlement_type_full":null,"settlement":null,"street_fias_id":"585eec0b-314c-4309-a497-3fe09300e903","street_kladr_id":"77000000000086100","street_with_type":"ул Бобруйская","street_type":"ул","street_type_full":"улица","street":"Бобруйская","house_fias_id":"f58e1c5c-7f50-4c01-92db-467ac7a0fa73","house_kladr_id":"7700000000008610055","house_type":"д","house_type_full":"дом","house":"34","block_type":null,"block_type_full":null,"block":null,"flat_type":"кв","flat_type_full":"квартира","flat":"25","flat_area":null,"square_meter_price":null,"flat_price":null,"postal_box":null,"fias_id":"f58e1c5c-7f50-4c01-92db-467ac7a0fa73","fias_level":"8","kladr_id":"7700000000008610055","capital_marker":"0","okato":"45268562000","oktmo":"45320000","tax_office":"7731","tax_office_legal":null,"timezone":null,"geo_lat":"55.7399231","geo_lon":"37.3958366","beltway_hit":null,"beltway_distance":null,"qc_geo":"0","qc_complete":null,"qc_house":null,"unparsed_parts":null,"qc":null}}]}
Запрос 2. С count=1 для unrestricted_value.
curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Token ****key****" -d "{ \"count\": 1, \"query\": \" г Москва, р-н Кунцево, ул Бобруйская, д 34, кв 25\" }" https://dadata.ru/api/v2/suggest/address
{"suggestions":[]}

Answer

Answer
Fixed

Исправили.

Planned

Алексей, да, есть проблема для адресов с районами, которых нет в базе налоговой (это как раз все районы Москвы). Уже решаем, на неделе выкатим исправление.

Аналогичная проблема наблюдается для районов Спб. Например адресов из Колпино.
г.Санкт-Петербург, г.Колпино, ул.Тверская д.47

Да, всё так. Причина в районах, которые отсутствуют в справочнике адресов налоговой.

Answer
Fixed

Исправили.