Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Пример работы с подсказками DaData на Python. Использует пакет requests (
# -*- coding: utf-8 -*-
import json
import requests
def suggest(query, resource):
url = BASE_URL % resource
headers = {
'Authorization': 'Token %s' % API_KEY,
'Content-Type': 'application/json',
data = {
'query': query
r =, data=json.dumps(data), headers=headers)
return r.json()
print suggest(u'москва хабаровская', 'address')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment