Github Twitter Telegram
Login

bitdb1.0

Bitcoin as Decentralized NoSQL Database


Join Chatroom Stay updated

0. Get API Key

Log in to get an 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.

Open Query Explorer

3. Make API Calls from Your App

The API consists of just a single URL endpoint. There are only three things to remember:

  1. Construct a JSON query: Construct a query in JSON, following Bitdb Query Language specification.
  2. Determine the API URL from the JSON query: https://bitdb.network/q/[BASE64 ENCODED JSON QUERY]
  3. Make an HTTP GET request with your API key in the header: Set the key header with your API key


in browser:

<html>
<body>
<pre>loading...</pre>
<script>
var query = {
  request: { find: {}, limit: 5 }
};
var b64 = btoa(JSON.stringify(query));
var url = "https://bitdb.network/q/" + b64;

var header = {
  headers: { key: "[YOUR API KEY]" }
};

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 = {
  request: { find: {}, limit: 5 }
};
var s = JSON.stringify(query);
var b64 = Buffer.from(s).toString('base64');
var url = "https://bitdb.network/q/" + b64;

var header = {
  headers: { key: "[YOUR API KEY]" }
};

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 Telegram Chatroom


Follow on Twitter to stay updated.

Follow on Twitter