SuredBits

SuredBits

Sports & Fitness

Query sports data, including teams, players, games, scores, and statistics. This API allows you to query our NFL, NBA and Crypto Exchange data. Our NFL and NBA APIs offer multiple channels including teams, players, games, scores, and statistics. Our Crypto Exchange API allows you to stream data on Trades, Tickers and Order Books.

Visit API

📚 Documentation & Examples

Everything you need to integrate with SuredBits

🚀 Quick Start Examples

SuredBits Javascript Examplejavascript
// SuredBits API Example
const response = await fetch('https://suredbits.com/api/', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Exploring the Public API Docs of Suredbits

Suredbits is a data provider for blockchain data, and they offer a public API for accessing their data. The API allows developers to create applications that can access blockchain data in real-time. In this blog, we will explore the various APIs available on Suredbits and provide code examples for JavaScript.

API Keys

To use the Suredbits API, you need an API key that you can obtain by registering on their website. Once you have the key, you can use it to make requests to the API.

Block Header API

The Block Header API allows you to retrieve the header of a given block in the Bitcoin blockchain. You can use the following code to retrieve the header of the block with the given block height:

const apiUrl = "https://api.suredbits.com/btc/main";

const blockHeight = 681114;

const response = await fetch(`${apiUrl}/header/${blockHeight}`, {
  headers: {
    "Content-Type": "application/json",
    Authorization: `Token ${API_KEY}`,
  },
});

const data = await response.json();

console.log(data);

Block API

The Block API allows you to retrieve the complete information about a given block in the Bitcoin blockchain. You can use the following code to retrieve the block with the given block height:

const apiUrl = "https://api.suredbits.com/btc/main";

const blockHeight = 681114;

const response = await fetch(`${apiUrl}/block/${blockHeight}`, {
  headers: {
    "Content-Type": "application/json",
    Authorization: `Token ${API_KEY}`,
  },
});

const data = await response.json();

console.log(data);

Transaction API

The Transaction API allows you to retrieve the complete information about a given transaction in the Bitcoin blockchain. You can use the following code to retrieve the transaction with the given transaction ID:

const apiUrl = "https://api.suredbits.com/btc/main";

const txid = "e073b6f86a7a0dcdc18c6eaf2f9f4d019a8d591d3dbafbe29729f4f9dd1af728";

const response = await fetch(`${apiUrl}/transaction/${txid}`, {
  headers: {
    "Content-Type": "application/json",
    Authorization: `Token ${API_KEY}`,
  },
});

const data = await response.json();

console.log(data);

Conclusion

This blog provides you with an overview of the Suredbits public API and code examples for using three of its APIs in JavaScript. With the help of these code snippets, you can retrieve the header of a given block, complete information about a block, and complete information about a transaction. You can explore more APIs on the Suredbits API documentation and integrate them into your applications for real-time blockchain data analysis.

📊 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Jun 7Jun 9Jun 11Jun 13Jun 15Jun 17Jun 19Jun 21Jun 23Jun 25Jun 27Jun 29Jul 1Jul 3Jul 604008001440Minutes
Online
Offline

Related APIs in Sports & Fitness