Git Product home page Git Product logo

universal-crypto-api's Introduction

universal-crypto-api

Endpoints of the most popular crypto exchanges aggregated into a central endpoint.

Requirements

  • Python 3.6
  • Pipenv

Installation

  1. git clone https://github.com/stephancill/universal-crypto-api.git
  2. cd universal-crypto-api
  3. pipenv install

Usage

To start the server, do pipenv run python src/main.py

URL query structure:

http://ENDPOINT/v<API_VERSION>/summary?<EXCHANGE_1>=<PAIR_1>,<PAIR_2>&<EXCHANGE_2>=<PAIR_1>,<PAIR_2>

e.g.

http://localhost:8080/v0/summary?bittrex=BTC-DOGE,BTC-ETH&coinbase=USD-BTC

The API currently supports the following exchanges:

  • Bittrex
  • Luno
  • Coinbase

The response has the following structure:

{
    "success": bool,
    "result": {
        "<EXCHANGE_1>": {
            "<PAIR_1>": {
                "endpoint": URL used to communicate with external API,
                "bid": float,
                "ask": float,
                "last": float,
                "volume": float (base),
                "yesterday": float, *
                "change": float (%) *
            },
            "<PAIR_2>": {...}
        },
        "EXCHANGE_2": {...}
    }
}

* Subject to availability

The result of the example query will be:

{
    "success": true,
    "result": {
        "bittrex": {
            "BTC-ETH": {
                "endpoint": "https://bittrex.com/api/v1.1/public/getmarketsummary?market=BTC-ETH",
                "bid": 0.04660601,
                "ask": 0.04679093,
                "last": 0.04678,
                "volume": 7982.8513052,
                "yesterday": 0.04696,
                "change": -0.38
            },
            "BTC-DOGE": {
                "endpoint": "https://bittrex.com/api/v1.1/public/getmarketsummary?market=BTC-DOGE",
                "bid": 3.2e-7,
                "ask": 3.3e-7,
                "last": 3.3e-7,
                "volume": 522.71876288,
                "yesterday": 3.3e-7,
                "change": 0
            }
        },
        "coinbase": {
            "USD-BTC": {
                "endpoint": "https://api.gdax.com/products/BTC-USD/ticker",
                "bid": 17396.48,
                "ask": 17397.32,
                "last": 17397.32,
                "volume": 49085.7326418
            }
        }
    }
}

Contributing

If you feel like contributing or adding an additional exchange, create a function in exchanges.py that accepts an array of symbol pairs (tuples) in the form [(base, other)] similar to the ones that are currently implemented and submit a pull request.

universal-crypto-api's People

Contributors

stephancill avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

reisap

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.