API to download data

  • With a valid API key and subscription, you can download the raw data via GET requests.

  • The availabe data fields are accessible in the Data section

  • Your API key is found at the My Account section.

  • You can purchase a subscription or add more days to an existing one at the Subscribe section.

Parameters

api_key

Your API key

start_block

Integer starting block height

end_block

Integer ending block height

columns

String with the name of the column (can be passed multiple times)

format

csv (default) or json

Examples

https://bitcoinisdata.com/api/get_data?api_key=XXXXXXXXXXXXXXXXXXXXXX

Download data from the default block height 800,000 onwards

https://bitcoinisdata.com/api/get_data?api_key=XXXXXXXXXXXXXXXXXXXXXX&start_block=600000

Download data from the block height 600,000 onwards

https://bitcoinisdata.com/api/get_data?api_key=XXXXXXXXXXXXXXXXXXXXXX&start_block=600000&end_block=650000

Download data between the block heights 600,000 and 650,000

https://bitcoinisdata.com/api/get_data?api_key=XXXXXXXXXXXXXXXXXXXXXX&start_block=875000&columns=heights&columns=price&columns=difficulty&format=json

Download specific columns in JSON format

Python Example Code

import requests
import pandas as pd

# Define the API endpoint and parameters
api_url = "https://bitcoinisdata.com/api/get_data"
params = {
    "api_key": "XXXXXXXXXXXXXXXXXXXXX",             # Replace with your actual API key
    "start_block": 875000,                          # Example start block
    "end_block": 875010,                            # Example end block
    "format": "json",                               # Request JSON format
    "columns": ["heights", "difficulty", "coins"]   # List of columns
}

# Make the GET request to the API
response = requests.get(api_url, params=params)

# Check if the request was successful
if response.status_code == 200:
    # Parse the JSON response
    json_data = response.json()

# Build a pandas dataframe:
df = pd.DataFrame(json_data)
print(df)