API

Welcome to the ChainSkope API documentation. To access our services programmatically, each request must be authenticated using your project-specific API key. We recommend keeping your requests private to protect your API key from exposure and prevent unauthorized usage that could impact your usage plan.

ChainSkope metrics are updated hourly, and our APIs support ERC-20, ERC-721, ERC-1155, and other standards. We're happy to add support for additional standards, please reach out.

API Key

Your API key has to be sent as the value of the header x-api-key

// Example
const headers = { 
    "x-api-key": "2Gljlz9zHf1hwOMrHDmmb4Tm1OKdVU4HbX03cXsb" 
}

Contract API

Metrics API

Chart Data API

Request Metrics Data for your chart.

post

Retrieves chart data for contracts and its metrics. Each metric is a line on the chart and bucket size, time range and breakdowns are applied to all lines if available.

Authorizations
Body
bucket_sizestring · enumRequiredExample: DAYPossible values:
Responses
200

Successful operation

application/json
post
/chart
POST /api/chart HTTP/1.1
Host: platform-api.chainskope.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 381

{
  "bucket_size": "DAY",
  "date_selection": {
    "id": "custom",
    "from": 1704067200000,
    "to": 1706745600000
  },
  "metrics": [
    {
      "contract_id": "0x1_0x4bd77619a75c8eda181e3587339e7011da75bf0e",
      "metric_id": "c76477a37262a754-143d-45cc-8518-12846e9e2503",
      "operation_id": "1f8be3cb-9aae-4d39-a96a-52ee636ff799"
    }
  ],
  "breakdowns": [
    {
      "id": "3429f57d-40bc-4efb-a7fb-9fc741a74798",
      "field": "currency_contract_address"
    }
  ]
}
{
  "success": true,
  "data": {
    "bucket_size": "DAY",
    "date_selection": {
      "id": "custom",
      "from": 1704067200000,
      "to": 1706745600000
    },
    "metadata": {
      "A: Sales": {
        "metric": "SALE_ERC721_VOLUME",
        "contract_id": "0x1_0x4bd77619a75c8eda181e3587339e7011da75bf0e",
        "contract_name": "Dolce&Gabbana Disco Drip",
        "chain_name": "Ethereum Mainnet",
        "contract_type": "ERC1155",
        "operation_name": "Sum USD"
      }
    },
    "metric_names": [
      "A: Sales"
    ],
    "series": {
      "A: Sales": {
        "1704067200000": 300,
        "1706745600000": 110
      }
    }
  }
}

Custom Contract Data API

Aggregate custom data from your contract events.

post

Retrieves paginated data based on aggregations from a contract custom event.

Authorizations
Body
pagenumberOptionalExample: 0
bucket_sizestring · enumOptionalExample: DAYPossible values:
contract_idstringOptionalExample: 0xa86a_0xa695ea0c90d89a1463a53fa7a02168bc46fbbf7e
fromnumberOptionalExample: 1606184371264
tonumberOptionalExample: 1798776371265
event_topicstringOptionalExample: 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
grouping_fieldsstring[]OptionalExample: ["operator","to","from"]
Responses
200

Successful operation

application/json
post
/data/metric
POST /api/data/metric HTTP/1.1
Host: platform-api.chainskope.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 408

{
  "page": 0,
  "bucket_size": "DAY",
  "contract_id": "0xa86a_0xa695ea0c90d89a1463a53fa7a02168bc46fbbf7e",
  "from": 1606184371264,
  "to": 1798776371265,
  "event_topic": "0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62",
  "operations": [
    [
      {
        "field": "value",
        "operation": "SUM",
        "custom_decimals": 0
      },
      {
        "field": "id",
        "distinct": true,
        "operation": "COUNT",
        "custom_decimals": 0
      }
    ]
  ],
  "grouping_fields": [
    [
      "operator",
      "to",
      "from"
    ]
  ]
}
{
  "success": true,
  "data": {
    "metric": "CUSTOM_FIELD_OPERATIONS",
    "contract_id": "0xa86a_0xa695ea0c90d89a1463a53fa7a02168bc46fbbf7e",
    "operation_name": "SUM, COUNT, COUNT",
    "field": "value, id, *",
    "buckets": [
      {
        "time": "1652659200000",
        "value": "2000",
        "id": "2",
        "aggregated_rows_count": "2",
        "operator": "0x562e487118c00106547885618ddf9473b52a656e",
        "to": "0xa597f915f5eb850eb0cb8709f1efd5f5256eab18",
        "from": "0x0000000000000000000000000000000000000000"
      },
      {
        "time": "1652659200000",
        "value": "750",
        "id": "2",
        "aggregated_rows_count": "2",
        "operator": "0x562e487118c00106547885618ddf9473b52a656e",
        "to": "0xf0fbd6998f8e97a561316f6ab8fe0c35ea490ea1",
        "from": "0x0000000000000000000000000000000000000000"
      }
    ]
  }
}

Get decoded custom events from your contract.

post

Retrieves paginated decoded custom events from a contract's custom event topic.

Authorizations
Body
pagenumberOptionalExample: 0
contract_idstringOptionalExample: 0xa86a_0xa695ea0c90d89a1463a53fa7a02168bc46fbbf7e
event_topicstringOptionalExample: 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
fromnumberOptionalExample: 1606184371264
tonumberOptionalExample: 1798776371265
Responses
200

Successful operation

application/json
post
/data/events
POST /api/data/events HTTP/1.1
Host: platform-api.chainskope.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 199

{
  "to": 1798776371265,
  "from": 1606184371264,
  "contract_id": "0xa4b1_0x26b1e2c6fda1e77ef193d424fcc4c4a42c7162af",
  "event_topic": "0xd879d5e7d9b51cf3fa46f67670befeb3a59fcab405350ea4bcb26cc6e7268a51",
  "page": 0
}
{
  "success": true,
  "data": {
    "metric": "CUSTOM_FIELD_OPERATIONS",
    "contract_id": "0xa4b1_0x26b1e2c6fda1e77ef193d424fcc4c4a42c7162af",
    "contract_name": "Staked Silo wstETH/WETH",
    "chain_name": "Arbitrum",
    "rows": [
      {
        "time": "1712193731000",
        "positionStrategy": "0xcc39Ed35F50406ab63C3513f05717F85525e2493",
        "positionId": "58",
        "amount": "7809999667995438",
        "debt": "27166775791202309"
      },
      {
        "time": "1711832628000",
        "positionStrategy": "0xE969BF5185E41e23d147B81147DC6bb448b9DcFE",
        "positionId": "57",
        "amount": "69292074869408637",
        "debt": "241037648799414445"
      },
      {
        "time": "1711775496000",
        "positionStrategy": "0x3CB415eA10E4205A9e6CFa49873357bd87b9729f",
        "positionId": "56",
        "amount": "42341064958163466",
        "debt": "48962692814805607"
      },
      {
        "time": "1711662132000",
        "positionStrategy": "0x92bf2EEa561c3609efE9c6482041119944eF52B6",
        "positionId": "55",
        "amount": "383900000000000000",
        "debt": "222541139007128019"
      },
      {
        "time": "1711467612000",
        "positionStrategy": "0xb3fEf293af25F4bC1b533BdC38f1A8ddB2dd7FFe",
        "positionId": "52",
        "amount": "6837322082716762",
        "debt": "3209271385944948"
      }
    ]
  }
}

Last updated