Last active
April 4, 2021 10:43
-
-
Save nalgeon/f1b5be65feb727dfd5ca555d3fafacdc to your computer and use it in GitHub Desktop.
Пример работы с подсказками DaData на R. Использует пакет httr (https://github.com/r-lib/httr)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(httr) | |
| url <- "https://suggestions.dadata.ru/suggestions/api/4_1/rs/findById/party" | |
| headers <- c( | |
| "Content-Type" = "application/json", | |
| Accept = "application/json", | |
| Authorization = "Token YOUR_API_KEY") | |
| body <- list( | |
| query = "7719402047") | |
| r <- POST(url = url, | |
| config = c(add_headers(headers), accept_json()), | |
| body = body, | |
| encode = "json") | |
| content(r) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Подскажите, пожалуйста, как в этот запрос вставить:
{
"query": "тануки",
"locations": [{"kladr_id": "77"}]
}