Get Bitcoin address details and Transaction List In PHP

In this post, we will see a Rest API of how to get Bitcoin address details and a Transaction list of any given address. The API is written in PHP but can be used in any language with related changes to that certain language.

Bitcoin is a cryptocurrency invented in 2008 by an unknown person or group of people using the name Satoshi Nakamoto and started in 2009 when its implementation was released as open-source software.

We use “file_get_contents” method to fetch data from the Blockchain database in JSON format and use it accordingly. We format the data properly and show it in this API.

Find the whole code below and use the code as it is wherever you want.

Sample API Response (You will get array response)

This can be modified according to your need. If file_get_contents doesn’t work for you try to enable it on your server using “allow_url_fopen“. Change allow_url_fopen to TRUE (1) if its disabled.
Or you can also use CURL request using above url.