Skip to content

Authentication

To authenticate yourself with the Transpose SQL API, simply issue a POST request to https://api.transpose.io/sql including your API key as the X-API-KEY header, and your query as the body. See the following example to get started:

API Key

Before proceeding, we need to authenticate ourselves with Transpose. To access any Transpose API, you'll need an API key. All API requests should include your API key in an X-API-KEY header. If you haven't already, you'll need to sign up and create a team (for free!). Once you have a team, you can find a list of your API keys in your team dashboard. When you have your API key, replace <YOUR-API-KEY> in the interactive examples below with your key.

Remember not to share your API key! Your API key is a secret, and should not be stored or exposed in a public manner.

SQL Query
SELECT
/* extract date */
timestamp::date AS date
FROM ethereum.nft_sales AS sales 
/* specify CryptoPunks contract address */
WHERE sales.contract_address = '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D'
/* group sales by date */
GROUP BY date
/* skip days with no sales */
HAVING COUNT(*) > 0; 

curl --request POST \
     --data '{"sql": "SELECT
timestamp::date AS date
FROM ethereum.nft_sales AS sales 
WHERE sales.contract_address = '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D'
GROUP BY date
HAVING COUNT(*) > 0;"}' \
     --url 'https://api.transpose.io/sql' \
     --header 'Content-Type: application/json' \
     --header 'x-api-key: FxKTp6MHpWQDaos8SRnSetdIZiUYLliS' \

Got questions? Join our Discord

Discord is the primary home of the Transpose developer community. Join us to ask questions, share your work, and get help.