Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A simple Clojure client for CartoDB with OAuth support.
Java Clojure
Pull request Compare This branch is 14 commits behind develop.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
dev
src/clj/cartodb
test/cartodb
.gitignore
README.md
project.clj

README.md

About

This is a very simple Clojure library for the CartoDB Maps and SQL API. It includes support for authentication via CartoDB API tokens and OAuth.

Examples

Here's a few usage examples:

(ns example
  (:use cartodb.client :as cdb))

;; Query a public table and get JSON results:
(cdb/query "SELECT * FROM table" "user")

;; Query a public table using API v1 and get JSON results:
(cdb/query "SELECT * FROM table" "user" :api-version "v1")

;; Query a public table and get GeoJSON results:
(cdb/query "SELECT * FROM table" "user" :format "geojson")

;; Query a public table and get CSV results:
(cdb/query "SELECT * FROM table" "user" :format "csv")

;; Query a public table on your own host:
(cdb/query "SELECT * FROM table" "user" :host "myserver.com")

;; Query a private table with OAuth credentials:
(def creds {:key "CARTODB_OAUTH_KEY"
            :secret "CARTODB_OAUTH_SECRET"
            :password "CARTODB_PASSWORD"})

(cdb/query "SELECT * FROM private_table" "user" :oauth creds)

Dependencies

The project is available on Clojars as a dependency for both Leinigen:

[cartodb-clj "1.5.2"]

and Maven:

<dependency>
  <groupId>cartodb-clj</groupId>
  <artifactId>cartodb-clj</artifactId>
  <version>1.5.2</version>
</dependency>

About the software

This software is designed and built by REDD Metrics. It's written in the Clojure programming language.

Contributors

Something went wrong with that request. Please try again.