Skip to content

A PHP script that grabs the latest bitcoin prices from top exchanges.

License

Notifications You must be signed in to change notification settings

petrospap/bitcoinTicker.php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Bitcoin Ticker

bitcoinTicker.php. A PHP script that helps you grab the latest bitcoin prices (in USD) from top exchanges.

Installation:

Include the following line somewhere in your php script.

include_once 'path/to/bitcoinTicker.php';

Available Functions:

Each of the following functions returns the latest USD value of one Bitcoin on the given exchange or price index. The functions are named after the excanhges, be careful of exchanges with similar sounding names.

  • coindeskBPI()
  • btcChina()
  • OKCoin()
  • bitfinex()
  • coinbase()
  • btce()
  • bitStamp()
  • campBX()
  • kraken()
  • crypto_trade()

Usage:

The following is a simple script that includes the bitcoinTicker.php and then prints the latest Coindesk Bitcoin Price Index

<?php
// Include the bitcoinTicker file
include_once('bitcoinTicker.php');

// Print the coindeskBPI
print_r(coindeskBPI());
?>

Output:

621.55

About

A PHP script that grabs the latest bitcoin prices from top exchanges.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%