Skip to content

Instantly share code, notes, and snippets.

@nalgeon

nalgeon/suggest.r

Last active Apr 4, 2021
Embed
What would you like to do?
Пример работы с подсказками DaData на R. Использует пакет httr (https://github.com/r-lib/httr)
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)
@alexeilutay

This comment has been minimized.

Copy link

@alexeilutay alexeilutay commented Apr 4, 2021

Подскажите, пожалуйста, как в этот запрос вставить:
{
"query": "тануки",
"locations": [{"kladr_id": "77"}]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment