Connecting via the API

Using curl to connect with an API key

A quick and easy way to get started exploring is with cURL.

First, grab your API key by clicking "Connect" and then "API / SDK", as shown below.


Then try running a command against one of our REST endpoints.
A list of supported endpoints can be found here:

As an example, let's query the API for information about all of your repos:

curl --request GET \
  --url \
  --header "Authorization: Bearer ${API_KEY}" \
  --header "Accept: application/json"

where API_KEY is set to your personal API key, as shown in the first line of the above snippet.

You can pipe the output of the above command to jq to optionally add JSON output formatting, as shown below:


The following curl example demonstrates how you could use the /query/ API endpoint run an arbitrary query against one of your repos:

curl --request POST \
     --url \
     --header "Authorization: Bearer ${API_KEY}" \
     --header "Accept: application/json" \
     --header "Content-Type: application/json" \
     --data '{"query_string":"SELECT count(*) FROM \"adam/FCC\".\"spectrum auction\" WHERE auction_id=107;"}'

Note the use of \ characters to escape double quotes embedded in the SQL query itself.

The JSON response for this API call includes the requested query, as well as the desired result:

  "query_string": "SELECT count(*) FROM \"adam/FCC\".\"spectrum auction\" WHERE auction_id=107;",
  "fields": {
    "count": "BIGINT"
  "data": [

Did this page help you?