bradtech/localbitcoins-client

A Http Client to authenticate with Localbitcoins API

dev-main 2022-06-06 20:59 UTC

This package is auto-updated.

Last update: 2025-08-07 04:11:43 UTC


README

A Localbitcoins Client for PHP with minimal dependencies. Should work right off the box.

Documentation for the Localbitcoins API can be found here: https://localbitcoins.com/api-docs/.

Installing

Make sure you have cURL enabled in your php environment.

php --ri curl

you should see this text on your terminal:

cURL support => enabled

Install with composer

composer require bradtech/localbitcoins-client

Usage

To use the HMAC Authentication Client, create a newHMACAuthenticationClient object and initialize with the HMAC key and secret from Localbitcoins.

<?php

// you can load the files dynamically
require_once 'vendor/autoload.php';

use Bradtech\LocalbitcoinsClient\HMACAuthenticationClient;

$hmac_key = 'HMAC_KEY';
$hmac_secret = 'HMAC_SECRET';

$client = new HMACAuthenticationClient($hmac_key, $hmac_secret);

$data = $client->getWalletAddress();

var_dump($data);