Skip to content

GraphQL fundamentals🔗

The Cryptosense v2 API uses GraphQL. Some familiarity with this query language is recommended to make the best use of the API but is not mandatory to complete the API tutorials.

You can use any HTTP client you’d like to send queries. Below is an example with curl that retrieves the name of the user:

$ export CS_API_KEY=<your API key>
$ curl \
    --request POST \
    --header "API-KEY: $CS_API_KEY" \
    --header 'Content-Type: application/json' \
    --data '{"query": "query {viewer {name}}"}' \
{"data":{"viewer":{"name":"<your username>"}}}

And here is the same query in Python:

import json
import os

import requests

cs_api_key = os.getenv("CS_API_KEY")
query = """
  query {
    viewer {
response =
    data=json.dumps({"query": query}),
    headers={"API-KEY": cs_api_key, "Content-Type": "application/json"},


Throughout this guide, we will assume you have chosen any suitable client and only show you the queries and responses.