Skip to content

Latest Blocks #44

@Horlabrainmoore

Description

@Horlabrainmoore
import requests
import json

url = "https://graphql.bitquery.io"

payload = json.dumps({
   "query": "query ($network: BitcoinNetwork!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) {\n  bitcoin(network: $network) {\n    blocks(\n      options: {desc: \"height\", limit: $limit, offset: $offset}\n      date: {since: $from, till: $till}\n    ) {\n      timestamp {\n        time(format: \"%Y-%m-%d %H:%M:%S\")\n      }\n      height\n      difficulty\n      transactionCount\n      blockSizeBigInt\n    }\n  }\n}\n",
   "variables": "{\n  \"limit\": 10,\n  \"offset\": 0,\n  \"network\": \"bitcoin\",\n  \"from\": \"2026-01-22T05:32:46.000Z\",\n  \"till\": \"2026-01-22T07:32:46.999Z\",\n  \"dateFormat\": \"%Y-%m-%d\"\n}"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer undefined'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions