Skip to content

Instantly share code, notes, and snippets.

@fixxer fixxer/dadata.clj
Last active May 16, 2019

Embed
What would you like to do?
(ns fixxer.dadata
(:require [clj-http.client :as http]
[cheshire.core :as json]))
(def api-key "your-api-key")
(def secret-key "your-secret-key")
(defn clean [request]
(->> request
json/generate-string
(assoc {:content-type :json
:headers {"Authorization" (str "Token " api-key)
"X-Secret" secret-key}} :body)
(http/post "https://dadata.ru/api/v2/clean")
:body
json/parse-string))
(let [request {:structure ["ADDRESS"]
:data [["Москва, Милютинский 13"]]}]
(println (clean request)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.