Skip to content

murilobsd/c-mercadobitcoin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status license

Unofficial library to communicate with MercadoBitcoin API

PLEASE DO NOT USE

Install

Before installing the library has dependencies:

  1. libcurl 3
  2. jannson
git clone https://github.com/murilobsd/c-mercadobitcoin.git mb
cd mb

Build lib:

make

Build example:

make example

Usage

#include <stdio.h>

#include <mb/mb.h>

int
main(int argc, char *argv[])
{
		FreeApi *f = freeapi_init();
		Sticker *st;

		f->ops->ticker(f, BTC);

		if (f->ops->get_error(f) != MBE_OK) {
				fprintf(stderr, "Error: %s\n", mb_get_strerro(f);
				return (1);
		}

		st = (Sticker *)f->ops->get_data(f);
		
		printf("=========== Ticker ============\n");
		printf("High: %f\n", st->high);
		printf("Low: %f\n", st->low);
		printf("Vol: %f\n", st->vol);
		printf("Last: %f\n", st->last);
		printf("Buy: %f\n", st->buy);
		printf("Sell: %f\n", st->sell);
		printf("Date: %u\n", st->date);
		printf("===============================\n");

		clean_freeapi(f);
		
		return (0);
}

and build

cc ticker.c -o ticker -lmbc
./ticker

ToDo

Free Api:

Method Status Test
ticker Implementing -
orderbook - -
trades - -
day-summary - -

Other libraries

Language Repo
Python https://github.com/alfakini/python-mercadobitcoin
Javascript https://github.com/marcbarbosa/mercadobitcoin
PHP https://github.com/diegoBSousa/mercadobitcoin-php-api

References

Releases

No releases published

Packages

No packages published