API integration DaData.ru address suggestions
Full documentation-API address hints - https://dadata.ru/api/suggest/address/
service DaData.ru (https://dadata.ru/suggestions/) provides the search API.
Searches for addresses in any part of the address from the region to the house («Tverskaya Nizhny 12» → «Nizhny Novgorod region, Nizhny Novgorod, Tverskaya street, d 12»).
Also searches by zip code («105568 »→ « g Moscow, Magnitogorsk street »).
Registration.
you need to register and confirm your email address.
Registration-https://dadata.ru/suggestions/usage/address/#registration_popup
Confirm your email address.
the API will start working after confirmation.
After registering in your personal account https://dadata.ru/profile/#info the API key and the Secret key for standardization will become available.
Subscription:The tariff is "Free", valid indefinitely. The possibility - Free up to 10,000 requests per day.
API request.
The format of the request.
- URL - https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address.
- – Post method.
- – Json format.
- Encoding-UTF-8.
- Content-Type – application/json.
- Accept – application/json.
- Authorization-Token 1d01d91d91d91d91d9f1d91d9____ - API key from your merchant profile.
Request body (json format):
{"query": "Moscow Serpukhovskaya", "count": 20 }
query-Query text (required)
count - Number of results (maximum of 20) (optional).
CREATE PROCEDURE [dbo].[api_daDataAddress_request]
@parameters ExtendedDictionaryParameter READONLY, -- incoming parameters for internal processing (use Key, Value2)
@username nvarchar(32) -- curent user.
AS
BEGIN
DECLARE @queryCount nvarchar(2) = 20 -- Number of results (maximum — 20)
SELECT @queryCount = ISNULL( Value2 , '20' ) FROM @parameters WHERE [Key] = 'queryCount'
IF LEN( ISNULL( @queryCount , '20' ) ) = 0
SET @queryCount = N'20'
DECLARE @queryStr nvarchar(max)
-- getting form field values from @parameters
SELECT @queryStr = ISNULL( Value2 , '' ) FROM @parameters WHERE [Key] = 'queryStr'
IF LEN( ISNULL( @queryStr , '' ) ) = 0
SET @queryStr = N'Moscow Serpukhov'
-- for testing
-- SET @queryStr = N'Moscow Serpukhov' -- @queryStr = N'Moscow Khabar' -- Query text
DECLARE @apiUrl1 nvarchar(max) = '' -- Final line to send -- IN FACT THIS IS Url
DECLARE @jsonRequest1 nvarchar(max) = '' -- тtext json-object
SET @apiUrl1 = 'https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address'
-- for testing -- SET @jsonRequest1 = N'{ "query": "Moscow Serpukhov", "count": 20 }'
--
SET @jsonRequest1 = N'{ "query": "'+ ISNULL( @queryStr, '' ) +'", "count": '+ TRY_CAST( ISNULL( @queryCount, '' ) AS nvarchar ) + ' }'
-------------------------------------------------------------------------------------------
-- ОТЛАДКА
insert into as_trace ( header, text, username, code , created ) values( 'apiUrl1' , @apiUrl1 , @username, 'api_daDataAddress_request' , GETDATE() )
insert into as_trace ( header, text, username, code , created ) values( '@jsonRequest1' , @jsonRequest1 , @username, 'api_daDataAddress_request' , GETDATE() )
-------------------------------------------------------------------------------------------
-- SELECT 1
select '' Msg, 1 Result
, @apiUrl1 Url
, 'application/json' ContentType -- explicit instruction for HEADER
-- SELECT 2 PARAMETERS - parameters that will be passed to an external source
select 'Authorization' name
, 'Token 1d01d91d91d91d91d9f1d91d9' value
, 'header' [type] -- form (in the form passed), header (in http headers), send get requests directly to the URL
union
select 'body' name
, @jsonRequest1 value -- this is body
, 'json' [type] -- form (in the form passed), header (in http headers), send get requests directly to the URL
END
In response to the request, an object with an array of suggestions in the suggestions field is returned.
Sample response (with abbreviations).
{
"suggestions": [
{
"value": "Moscow, Khabarovsk street",
"unrestricted_value": "Moscow, Khabarovsk street",
"data": {
"postal_code": null,
"country": "Russia",
"country_iso_code": "RU",
"federal_district": null,
"region_fias_id": "0c5b2444-70a0-4932-980c-b4dc0d3f02b5",
}
},
...
]
}
As a result of parsing the response, the procedure returns the following result:
Query: Tverskaya Nizhny 12
query Results: Region: [Nizhny Novgorod region][Tver region].
unique emails Found.indexes-2.
Addresses-3.
Address |
Index |
Tver region, Staritsky district, village of Nizhny Spass, d 12 |
171372 |
Tver region, Staritsky district, village of Nizhny Spass, d 12 |
171372 |
Nizhny Novgorod, Tverskaya street, d 12 |
603105 |
Note. The parsing procedure outputs only three fields Address, Index, and Region.
There are more than 70 fields in the response of the service for a single address. you can get the most detailed information for each address, including the values of all classifiers.
The response procedure is [dbo].[api_daDataAddress_response] - available by link.
- Management
- Falcon Space Foundation
- Basic components
- Falcon Space Features
- Коммуникация с пользователем
- Дизайн, стилизация
- Integrations Integration import and parsing of a CSV file API integration DaData.ru address suggestions Integration of the IpGeoBase API City by IP address API integration DaData.ru City by IP address Falcon Space. Creating an API service (incoming and outgoing API requests) How to make a web hook Прием платежей через Яндекс.Кассу Online payments. Integration with ROBOKASSA (payment gateway) Zapier integration on the Falcon Space platform Integration of MANGO OFFICE call tracking (Platform mode) Integration of the API exchange Rates of the Central Bank of the Russian Federation Integration of the Russian Post API Integration API of the CDEK delivery service API integration Service delivery Business lines How to calculate the distance between two points with coordinates via Google Maps File transfer via FTP Scan barcodes and QR codes through the camera and from images Receiving data of the counterparty through the TIN Accepting payments on the website via CloudPayments Programmatic interaction via the API between 2 different Falcon instances Как сделать интеграцию с Мой Склад Внедрение подсказок dadata на сайт Вывод точек на карте Яндекс. Интеграция с Яндекс Карты Интеграция с телефонией Zadarma.com Как передать скрытый параметр при исходящем запросе из Request процедуры в Response Получение данных о контрагенте - интеграция с сервисом ЗаЧестныйБизнес Интеграция с AMO CRM Как импортировать данные в базу CRM из Google Контакты Вход/регистрация через ВКонтакте(vk.com)
- Каталоги
- Навигация
- Документы
- Additional component
- Продвижение, SEO
- Системные моменты
- HOWTO
- HOWTO Tables
- HOWTO Forms
- Working with SQL
- HOWTO JS
- HOWTO Layout
- Solve problems
Falcon Space Platform
This is a reduction in the cost of ownership
at the expense of fewer people to support
This is a quick change
while using the program
This is a modern interface
full adaptation for mobile devices
- Falcon Space Video
- Platform features demo will allow you to understand how this or that component looks and works
- Have a question? Write to the chat at the bottom right