Amberdata Blog

Bitcoin now available in Amberdata.io, a single integration unlocking multi-blockchain features

Written by Trevor Clarke | Oct 4, 2019

Today we’re releasing RPC, REST & Websocket support for bitcoin within Amberdata’s comprehensive API platform. At the core, bitcoin’s full blockchain data is available for use in queries, analysis, actions & reporting. As with all Amberdata products, cryptocurrency market data & validation data is added to enable a trustless scalable system.

Get started at Amberdata.io today!

For the past year, we have been building products & services that help grow the cryptocurrency and blockchain ecosystem. Our vision is to make peer-to-peer economic assets simple to integrate and let businesses focus on delivering their core products. We value decentralized, self-sovereign innovation —a first-of-its-kind layer that enables the global economy to thrive. Understanding Bitcoin shouldn’t stop business integration; we’re aiming to broaden adoption with the launch of our on-boarding tools.

Bitcoin: A Peer-to-Peer Electronic Cash System

Announced in 2008 by Satoshi Nakamoto, and formally launched in 2009, *Bitcoin has become a house-hold term for all things digital currency. For some developers, bitcoin was the first cryptocurrency where it was possible to mine a tradable asset and program it to exchange value for other goods.

Bitcoin has grown dramatically, with over 450 million transactions, billions of dollars in value being sent with tiny fees, it is finally a first class global entity.

Source: https://thebitcoinwhitepaper.com/

Core features & uses of Bitcoin:

  1. Peer-to-Peer Value Transfer — Simple Payment Verification enabling all participants trust-less transactions.
  2. Store of Value — Ownership is decentralized, exchange from any currency to any other currency or cryptocurrency
  3. Borderless — Globally available, globally acceptable
  4. Control —Keys can be generated and stored offline, HODLing is encouraged, paper wallets for gifting, ATMs
  5. Historic test cases: Bitcoin pizza, Bitcoin Coffee Shop

Why add Bitcoin to your business?

As businesses investigate and test interoperability between decentralized networks(IBM, Intel, Microsoft, Amazon, Facebook, etc), it becomes quite clear that the internet as a whole is moving away from “walled gardens” and into an era of market driven interactions. Traditional business dictates that intellectual property and defensibility are the key engines that drive sustainability, growth and revenue. Systems like Paypal, Venmo and even Visa, succeed if all the users are interacting within their system and loading their accounts with currency in each providers system. The internet has enabled innovations that break down these walls, now users are able to make purchases, transfer assets, create marketplaces, exchange value without intermediaries — the list goes on.

If users control the transaction engine, how can a business participate and be successful?

A simple analogy: The industrial revolution was taking traditional products and streamlining the manufacturing. The internet is a universal layer available to all, but still a traditional service/product mindset. Blockchain protocols enable the hyper-streamlining of asset transfer and economic utility function. This is the protocol revolution — interoperability, control, access are all features & demands that will be vital for a business to accommodate.

A familiar example: Your child is playing a game from a phone app store, they nag you to buy them in-game tokens to get an upgraded feature or asset. You then have to trade USD for an electronic “tally” amount.

As a business, this may not seem enticing, unless that same system can enable dynamic value transfer, digital marketplaces, remittances, supply chain, certifications, digital law, etc. The core value becomes interoperability, asset creation and protocol inclusion, the same way that utility strategy from long time telco operated — innovation on inclusion will drive new demand.

Great, but is it practical?

Integrating Bitcoin or blockchain in general may seem daunting. Businesses today have to run specific servers, learn the protocol, setup account management layers, sync data for days/weeks…

Businesses and applications need high availability, scalability, ease of integration, full feature support, alerting and more.

Investors, traders, exchanges and wallets need full transaction data, account portfolios, activity, verification, custom metrics and insights.

Enter Amberdata.io, a Bitcoin partner

We’re excited to be launching Bitcoin protocol & cryptocurrency* within our platform. Now it’s as simple as connecting directly to a unified API. On top of the basics — blockchain connectivity, raw blockchain data like blocks, transactions, account current balances — we have added the full context of market data within each data type. Knowing and acting on market data is now possible without needing to connect, map, store and deliver 20+ APIs.

Add Bitcoin — No syncing required, no cli, no protocol learning curve, no dev-ops or server management (All of which can cost hundreds to thousands per month), add Bitcoin within minutes.

Using Amberdata includes:

  1. REST — A full API with standardized data sets, across blockchains
  2. WebSockets — Streaming data and updates, realtime from the network
  3. RPC — Connect directly to the node without running the node

For businesses and applications this brings reduced cost, high speed, high throughput, full availability including historical data.

For investors, traders, exchanges, wallets, now you can connect directly to a unified market and blockchain API, no extra headaches.

How would we…

  • Connect to Bitcoin?
  • Add cryptocurrency to our business?
  • Get transactions and point-in-time value?
  • Get account portfolio and balances?

Adding Bitcoin is simple:

For developers, enable bitcoin with a simple variable

1. Get your Free API Key

Go to Amberdata.io to Get Started.

2. Make your first request — Account Balance

Get account balance by using our documentation directly. Next, go to this page in our documentation. Copy your Amberdata API key to clipboard, and paste it into the “Header Auth” box:

Add Amberdata API to make a request

Add the bitcoin address “3HqH1qGAqNWPpbrvyGjnRxNEjcUKD4e6ea” to the “hash” parameter.

Lastly, add the Bitcoin blockchain Id “408fa195a34b533de9ad9889f076045e” to the x-amberdata-blockchain-id input:

Add Bitcoin blockchain ID

Click “Try It”. Now you can see account balance data for this address.

Add our SDK, Web3data.js

The above steps were cool, but we’ve made things a lot simpler! Using the web3data.js SDK, you can get blockchain & market data directly without having to learn our API. Fortunately, we have a full setup guide here:

Web3data-js — Getting real-time Ethereum blockchain and market data has never been easier.

1 API key + a few lines of code, and you’ll have instant access to the most comprehensive offering of real time…

medium.com

We also just launched the SDK docs here →

However, we can also test right within this blog post! If you have your API key handy, follow me to the next couple examples:

Try the basics, and the extras — Blocks & Transactions

Go here to test in action →

const Web3Data = require("web3data-js")const w3d = new Web3Data('YOUR_API_KEY')const latestBlock = await w3d.btc.block.getBlocks()const latestBlockTxns = await w3d.btc.block.getTransactions(597875, {includePrice: true})

Bonus — Get Account Balance with Market Value →

Get account transaction updates with Websockets

Go here to test in action →

const Web3Data = require("web3data-js")const w3d = new Web3Data('YOUR_API_KEY', {  blockchainId: "408fa195a34b533de9ad9889f076045e"})// Initialize the connectionw3d.connect()// Subscribes to address transaction eventsw3d.on({  eventName: 'address:transactions',  filters: {address: "3HqH1qGAqNWPpbrvyGjnRxNEjcUKD4e6ea"}}, transaction => {  // Log the transaction data  console.log(transaction)  // Terminate the socket connection  w3d.disconnect()})

Using RPC to send & receive Bitcoin data

Go here to test in action →

const Web3Data = require("web3data-js")const w3d = new Web3Data('YOUR_API_KEY')const bestBlockHash = await w3d.btc.rpc('getbestblockhash')

Web3data supports everything Bitcoin within the namespace .btc — making things super simple to add to your application!

Get postman collection for easy API testing

Finally, for ongoing development, we’ve created a postman collection that covers all of our features and utilizes simple parameters so you can focus on building. Click here to download the collection directly