API Key
1. Learn Bitdb Query Language
Learn how to make queries to Bitdb:Bitdb Query Language Docs
Explore some example queries:
Explore Demos
2. Experiment with Queries
Try experimenting with your own queries with query explorer.Select a Node
3. Make API Calls from Your App
The API consists of just a single URL endpoint. There are only three things to remember:- Construct a JSON query: Construct a query in JSON, following Bitquery specification.
-
Determine the API URL from the JSON query:
https://genesis.bitdb.network/q/1FnauZ9aUH2Bex6JzdcV4eNX7oLSSEbxtN/[BASE64 ENCODED JSON QUERY]
- Make an HTTP GET request with your API key in the header: Set the key header with your API key
Select a Node
in browser:
<html> <body> <pre>loading...</pre> <script> var query = { v: 3, q: { find: {}, limit: 5 } }; var b64 = btoa(JSON.stringify(query)); var url = "https://bitgraph.network/q/" + b64; var header = { headers: { key: "qpkc8recx4glerhe0razu9e75pzyuxvjgcn2sf9cj8" } }; fetch(url, header).then(function(r) { return r.json() }).then(function(r) { var result = JSON.stringify(r, null, 2); document.querySelector("pre").innerHTML = result; }) </script> </body> </html>
node.js
var axios = require('axios') var query = { v: 3, q: { find: {}, limit: 5 } }; var s = JSON.stringify(query); var b64 = Buffer.from(s).toString('base64'); var url = "https://bitgraph.network/q/" + b64; var header = { headers: { key: "qpkc8recx4glerhe0razu9e75pzyuxvjgcn2sf9cj8" } }; axios.get(url, header).then(function(r) { console.log("Fetched: ", r.data) })
4. Join the Community
Join the chatroom to share what you're working on, ask questions, and even contribute to the project!Join Slack Chatroom
Follow on Twitter to stay updated.
Follow on Twitter