I'm having some real trouble setting up the Blockchain API on my server

First off is it possible to test it offline with local host?

Secondly, how do I set it up so when a tx is made through my site, it runs a php function to update a database with certain values

Has anyone successfully set up the API before and if so could they please walk me through how I would do it


3 Answers 3


It is possible to test it offline. Check your phpinfo() to confirm, but I perform operations with the blockchain API from my XAMPP server all the time, as I am currently working on a site that uses the API. All you're doing is sending a request to a URL (like when you loaded this page) and getting the contents of that file. If you're interested, check out this class I wrote for using the blockchain API with PHP: https://github.com/lukesims/Blockchain-API-PHP-Class

With that, you could ad more functions or modify it to interact with your database simultaneously.


Here's an example of an IPN that works with the Blockchain API:



Its not possible to test it offline (probably because of file_get_contents() function which is present in create.php )

Second, as far as I know, you would have to write your update queries or whatever you want to do, inside the callback.php file, which is called by Blockchain itself once a transaction has been done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.