Skip to content

roozbeh360/coinex_php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coinex API PHP

Coinex digital coin exchange API for PHP

Requirements

  • PHP>=7.1
  • CURL PHP module

Install

composer require roozbeh/coinex_php

Acquire access_id and secret_key

Sign in to CoinEx before invoking API and get Acquire access_id/secret_key in Account > API.

access_id: To mark identity of API invoker

secret_key: Key to sign the request parameters

Setup request

<?php
use Roozbeh\CoinexPhp\Market;


//use this variable in some functions as global
$access_id = '<ACCESS_ID>';
$secret_key = '<SECRET_KEY';



$market = new  Market($access_id,$secret_key);
$result = $market->acquireMarketList();

Set proxy

The proxy is optional.
Use proxy URL with this format: scheme://[username:password@]hostname:port
For examples:

$proxy = 'socks5://user:pass@localhost:12345';
$proxy = 'http://127.0.01:8080';

And so use this proxy when setup request:

$market = new  Market($access_id,$secret_key,$proxy);
$result = $market->acquireMarketList();

Set params

//params if nedded
//IMPORTANT: no needed set access_id, tonce into params.
$market->acquireMarketStatistics('BCHBTC');

Wiki

See all requests, params and responses in here official wiki.