API Documentation

Introduction

Welcome to Bytemine.io's API Hub. You can use our API to access API endpoints and our own signals, which can get information on Fundamentals of a Ticker, Historical Data, Pre-Processed Signals and more from our database.

Currently, we have language bindings in only Shell. However, you can easily translate this to whichever platform/language you are using as these are just simple API calls. You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

We offer compelling data services for a highly competitive price, if you decide to switch to one of our premium plans. On top of that you get access to the Trader's platform as well.

If you have any questions or want to raise a concern/query, please drop in a mail at [email protected]. We'll try our best to answer your queries within 24 working hours.

Authentication

No tricky authorization mechanisms. Authorization of the API key is essential for requesting data.

# With shell, you can just pass the correct API key with each request
curl https://app.bytemine.io/api/checkForCandlestick/{api_key}/...
$.ajax({
        url: "https://app.bytemine.io/api/checkForCandlestick/{api_key}/...",
        type: 'GET',
        success: function(data) {
            console.log(data);
        }
    });

Make sure to replace {api_key} with your API key.

To use the API you have to have an API key. You can get an API key from our developer portal.

The API key should be included in all API requests to the server

Signals

Candlestick Patterns

The above command returns JSON structured like this:

You can get Candlestick Patterns from our API endpoints. This can be achieved using Long Polling. However, make sure to not call our Endpoints without adding atleast a 1 Min Delay.

HTTP Request

GET https://app.bytemine.io/api/checkForCandlestick/{api_key}/{ticker}/{timeframe}

Query Parameters

Parameter

Default

Description

api_key

true

API Key is required for authentication.

ticker

true

A ticker/symbol is needed for the appropriate candlestick pattern to be returned.

timeframe

true

Only one Timeframe out of these - 1m/2m/5m/15m/30m/60m/90m/1d/5d/1wk/1mo

Example HTTP Request

GET https://app.bytemine.io/api/checkForCandlestick/5fe69c95ed70a9869d9f9af7d8400a6673bb9ces/AAPL/5m

The above command returns JSON structured like this:

Trends can be classified into three categories - Bullish, Bearish, Neutral. This can be achieved using Long Polling. However, make sure to not call our Endpoints without adding atleast a 1 Min Delay.

HTTP Request

GET https://app.bytemine.io/api/getTickerTrend/{api_key}/{ticker}/{timeframe}

Query Parameters

Parameter

Default

Description

api_key

true

API Key is required for authentication.

ticker

true

A ticker/symbol is needed for the appropriate candlestick pattern to be returned.

timeframe

true

Only one Timeframe out of these - 1m/2m/5m/15m/30m/60m/90m/1d/5d/1wk/1mo

Stock Market Data

Country Abbreviations

In some cases you might need country abbreviations to query the data. For example - if you want to find the list of stocks that a country has then you'd have to use country abbreviations. You can check the list of supported countries and their abbreviations from over here - https://airtable.com/shrffQ8hRyl0LKAQH/tbl9lvQLZq9nryClu.

Get List of all tickers of a Country

The above command returns JSON structured like this:

The API endpoint requires 3 parameters -> API key, country abbreviation and finally an offset. You can get the country abbreviation from the above step. For offset the default value that you should enter is 0. Since the data is picked up from our SQL database hence we require an offset param to determine which next set of data should we output. You can read about offset from here.

If you still have questions about this then please contact us at [email protected].

Get Country's Most Active stocks

The above command returns JSON structured like this:

The API endpoint requires 3 parameters -> API key, country abbreviation and finally an offset. You can get the country abbreviation from the Step 2 (under Stock Market Data). For offset the default value that you should enter is 0. Since the data is picked up from our SQL database hence we require an offset param to determine which next set of data should we output. You can read about offset from here.

At a time, the API returns a maximum of 200 tickers (if tickers in a country are greater 200). If you still have questions about this then please contact us at [email protected].

Get OLHCV Data of Tickers via single API Call

The above command returns JSON structured like this:

The API endpoint requires 2 parameters -> API key, and list of ticker separated by a 'comma'. Since you'd be passing this list in a URL you'd have to convert this comma separated string into ascii codes. What this means is convert all commas into %2C. Please refer here for more details.

Please check out the example by switching over to the Javascript tab to know more about how to format this request. If you still have questions about this then please contact us at [email protected].

Company Details

The above command returns JSON structured like this:

You can get company details of any stock from our API endpoints. This can be achieved using Long Polling. However, make sure to not call our Endpoints without adding atleast a 1 Min Delay.

HTTP Request

GET https://valhalla.bytemine.workers.dev/companyDetails/{api_key}/{ticker}

Query Parameters

Parameter

Default

Description

api_key

true

API Key is required for authentication.

ticker

true

A ticker/symbol is needed for the appropriate candlestick pattern to be returned.

Example HTTP Request

GET https://valhalla.bytemine.workers.dev/companyDetails/afdhesdf/TSLA

Open High Low Close Volume

The above command returns JSON structured like this:

You can get OLHC data of any stock from our API endpoints. This can be achieved using Long Polling. However, make sure to not call our Endpoints without adding atleast a 1 Min Delay.

HTTP Request

GET https://valhalla.bytemine.workers.dev/olhc/{api_key}/{ticker}/{timeframe}/{range}

Query Parameters

Parameter

Default

Description

api_key

true

API Key is required for authentication.

ticker

true

A ticker/symbol is needed for the appropriate candlestick pattern to be returned.

timeframe

true

Only one Timeframe out of these - 1m/2m/5m/15m/30m/60m/90m/1d/5d/1wk/1mo

range

true

Only one Range out of these - 1d/5d/1mo/3mo/6mo/1y/2y/5y/10y/ytd/max

Example HTTP Request

GET https://valhalla.bytemine.workers.dev/olhc/afdhesdf/TSLA/5m/5d

Similar Stocks

The above command returns JSON structured like this:

You can get similar stocks from our API endpoints. This can be achieved using Long Polling. However, make sure to not call our Endpoints without adding atleast a 1 Min Delay.

HTTP Request

GET https://valhalla.bytemine.workers.dev/similar/{api_key}/{ticker}

Query Parameters

Parameter

Default

Description

api_key

true

API Key is required for authentication.

ticker

true

A ticker/symbol is needed for the appropriate candlestick pattern to be returned.

Example HTTP Request

GET https://valhalla.bytemine.workers.dev/similar/afdhesdf/TSLA

Company Summary

The above command returns JSON structured like this:

You can get company summary of any stock from our API endpoints. This can be achieved using Long Polling. However, make sure to not call our Endpoints without adding atleast a 1 Min Delay.

HTTP Request

GET https://valhalla.bytemine.workers.dev/summary/{api_key}/{ticker}

Query Parameters

Parameter

Default

Description

api_key

true

API Key is required for authentication.

ticker

true

A ticker/symbol is needed for the appropriate candlestick pattern to be returned.

Example HTTP Request

GET https://valhalla.bytemine.workers.dev/summary/afdhesdf/LSE.L

Errors

Error Code

Meaning

400

Bad Request -- Your request is invalid.

401

Unauthorized -- Your API key is wrong.

403

Forbidden -- You are not authorized to access this.

404

Not Found -- The specified function/api method could not be found.

406

Not Acceptable -- You requested a format that isn't json.

429

Too Many Requests -- You're requesting data at a very fast rate! Slow down!

500

Internal Server Error -- We had a problem with our server. Try again later.

503

Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

Last updated