Pix APIs - Realtime and Historical Data in REST

Pix APIs - Realtime and Historical Data in REST

Introduction

ACCELPIX REST API is a robust interface designed for downloading historical and tick data efficiently. Whether you're looking to retrieve End of Day (EOD) data, intra-EOD data, live intra OHLC (Open, High, Low, Close) data, or quotes, this API provides comprehensive endpoints to meet your needs. Seamlessly integrate market data into your applications with simple and straightforward API calls.

Features

  • Historical Data Retrieval: Access EOD and intra-EOD data for comprehensive market analysis.
  • Live Tick Data: Stream live market data with high-frequency updates.
  • Quotes Data: Fetch real-time quotes for multiple tickers simultaneously.
  • Master Data Access: Retrieve detailed master data for symbols and instruments.
  • Flexible Integration: Easily integrate with various programming languages and platforms.



Authentication

All API requests require authentication using an API token. The API token must be included as a query parameter in each request.

How to Obtain an API Token

  1. Register: Sign up on the ACCELPIX platform to create an account.
  2. Generate Token: Navigate to the API section in your account dashboard to generate a new API token.
  3. Secure Your Token: Keep your API token confidential to prevent unauthorized access.

Including the API Token in Requests

Add the api_token query parameter to your API requests as shown in the examples below.

  1. api_token={your_api_key

Endpoints

EOD Data

Retrieve End of Day (EOD) data for a specific ticker within a date range.

  1. URL: GET http://{server}/api/fda/rest/{ticker}/{yyyyMMdd:start}/{yyyyMMdd:end}?api_token={your_api_key}
  2. Method: GET
  3. Description: Fetches EOD data for the specified ticker between the start and end dates.

Parameters

Parameter
Type
Description
{ticker}
string
The ticker symbol (e.g., "NIFTY 50").
{start}
string
Start date in yyyyMMdd format (e.g., "20240101").
{end}
string
End date in yyyyMMdd format (e.g., "20240115").
api_token
string
Your unique API token for authentication.


Example Request
  1. GET http://apidata.accelpix.in/api/fda/rest/NIFTY%2050/20240101/20240115?api_token=cvFRDRmyKXp2%2BY9KKgPBfC0%3Dm


Example Response

  1. [ { "tkr": "NIFTY 50", "td": "2024-01-01 00:00:00", "op": 21727.8000, "hp": 21834.3000, "lp": 21680.8000, "cp": 21741.9000, "vol": 0, "oi": 0, "eod": true }, { "tkr": "NIFTY 50", "td": "2024-01-02 00:00:00", "op": 21751.3000, "hp": 21755.6000, "lp": 21555.7000, "cp": 21665.8000, "vol": 0, "oi": 0, "eod": true } ]


Intra-EOD Data

Retrieve intra-EOD data for a specific ticker within a date range and specified resolution.

  1. URL: GET http://{server}/api/fda/rest/{ticker}/{yyyyMMdd:start}/{yyyyMMdd:end}/{resolution:minutes}?api_token={your_api_key}
  2. Method: GET
  3. Description: Fetches intra-EOD data with minute-level resolution for the specified ticker between the start and end dates.


Parameters

Parameter
Type
Description
{ticker}
string
The ticker symbol (e.g., "NIFTY 50").
{start}
string
Start date in yyyyMMdd format (e.g., "20240111").
{end}
string
End date in yyyyMMdd format (e.g., "20240112").
{resolution}
string
Time resolution in minutes (e.g., "5").
api_token
string
Your unique API token for authentication.

Example Request
  1. GET http://apidata.accelpix.in/api/fda/rest/NIFTY%2050/20240111/20240112/5?api_token=cvFRDRmyKXp2%2BY9KKgPBfC0%3Dm

Example Response

  1. [ { "tkr": "NIFTY 50", "td": "2024-01-11 09:15:00", "op": 21688.8000, "hp": 21725.4000, "lp": 21683.4000, "cp": 21720.4000, "vol": 8554608, "oi": 0, "eod": false }, { "tkr": "NIFTY 50", "td": "2024-01-11 09:20:00", "op": 21721.1000, "hp": 21726.5000, "lp": 21693.1000, "cp": 21693.1000, "vol": 4901900, "oi": 0, "eod": false }, { "tkr": "NIFTY 50", "td": "2024-01-11 09:25:00", "op": 21692.6000, "hp": 21720.1000, "lp": 21690.4000, "cp": 21703.9000, "vol": 5450636, "oi": 0, "eod": false } ]


Live Intra OHLC

Retrieve live intra-OHLC (Open, High, Low, Close) data for a specific ticker within a precise time range and resolution.

  1. URL: GET http://{server}/api/fda/rest/{ticker}/{yyyyMMdd HH:mm:ss-start time}/{yyyyMMdd HH:mm:ss-end time}/{resolution:minutes}?api_token={your_api_key}
  2. Method: GET
  3. Description: Fetches live intra-OHLC data with minute-level resolution for the specified ticker between the start and end times.


Parameters

Parameter
Type
Description
{ticker}
string
The ticker symbol (e.g., "NIFTY 50").
{start}
string
Start time in yyyyMMdd HH:mm:ss format (e.g., "20240112 15:00:00").
{end}
string
End time in yyyyMMdd HH:mm:ss format (e.g., "20240112 15:15:00").
{resolution}
string
Time resolution in minutes (e.g., "5").
api_token
string
Your unique API token for authentication.


Example Request
  1. GET http://apidata.accelpix.in/api/fda/rest/NIFTY%2050/20240112%2015:00:00/20240112%2015:15:00/5?api_token=cvFRDRmyKXp2%2BY9KKgPBfC0%3Dm


Example Response

  1. [ { "tkr": "NIFTY 50", "td": "2024-01-12 15:00:00", "op": 21903.8000, "hp": 21922.0000, "lp": 21892.6000, "cp": 21893.3000, "vol": 6963597, "oi": 0, "eod": false }, { "tkr": "NIFTY 50", "td": "2024-01-12 15:05:00", "op": 21888.8000, "hp": 21899.8000, "lp": 21857.0000, "cp": 21858.3000, "vol": 8481726, "oi": 0, "eod": false }, { "tkr": "NIFTY 50", "td": "2024-01-12 15:10:00", "op": 21858.8000, "hp": 21884.9000, "lp": 21852.6000, "cp": 21876.0000, "vol": 7293602, "oi": 0, "eod": false } ]


Quotes Data

Retrieve real-time quotes for multiple tickers.

  1. URL: POST http://{server}/api/fda/rest/quote?api_token={your_api_key}
  2. Method: POST
  3. Description: Fetches the latest quotes for the specified list of tickers.


Parameters

Parameter
Type
Description
api_token
string
Your unique API token for authentication.


Parameter Type Description api_token string Your unique API token for authentication.


Request Body

Provide an array of ticker symbols for which you want to retrieve quotes.

  1. ["TCS", "NIFTY-1"]


Example Request

  1. POST http://apidata.accelpix.in/api/fda/rest/quote?api_token=cvFRDRmyKXp2%2BY9KKgPBfC0%3Dm
  2. Content-Type: application/json ["TCS", "NIFTY-1"]


Example Response

  1. [ { "tkr": "TCS", "sid": 1, "tkn": 0, "tm": 1332344400, "pr": 3626.7, "qty": 0, "vol": 2413206, "bp": 0.0, "bq": 0, "ap": 3626.7, "aq": 1163, "op": 3696.0, "cp": 3626.7, "hp": 3713.95, "lp": 3615.0, "avg": 3650.29, "oi": 0, "val": 0.0, "band": 10, "upc": 3989.35, "lrc": 3264.05, "poi": 0, "chg": 0.0, "chgpc": 0.0 }, { "tkr": "NIFTY-1", "sid": 2, "tkn": 0, "tm": 1332343800, "pr": 17167.85, "qty": 200, "vol": 9308800, "bp": 17163.1, "bq": 200, "ap": 17167.9, "aq": 850, "op": 17332.2, "cp": 17322.05, "hp": 17392.1, "lp": 17130.65, "avg": 17234.96, "oi": 10866050, "val": 0.0, "band": 0, "upc": 0.0, "lrc": 0.0, "poi": 10866050, "chg": -154.20117, "chgpc": -0.89 } ]


Master Data

Retrieve master data for all available symbols and instruments.

  1. URL: GET http://{server}/api/fda/rest/master?api_token={your_api_key}
  2. Method: GET
  3. Description: Fetches master data containing detailed information about all symbols and instruments.


Parameters

Parameter
Type
Description
api_token
string
Your unique API token for authentication.

Example Request
  1. GET http://apidata.accelpix.in/api/fda/rest/master?api_token=cvFRDRmyKXp2%2BY9KKgPBfC0%3Dm


Example Response

  1. [ { "xid": 1, "tkr": "NIFTY 50", "atkr": "NIFTY_50", "ctkr": null, "exp": "1970-01-01 00:00:00", "utkr": null, "inst": "INDEX", "a3tkr": null, "sp": "0.00", "tk": 99, "lot": 0 }, { "xid": 1, "tkr": "TCS", "atkr": null, "ctkr": null, "exp": "1970-01-01 00:00:00", "utkr": null, "inst": "EQUITY", "a3tkr": null, "sp": "0.00", "tk": 11536, "lot": 0 }, { "xid": 2, "tkr": "BANKNIFTY-1", "atkr": "BANKNIFTY_1", "ctkr": "BANKNIFTY22JUL", "exp": "2024-01-16 00:00:00", "utkr": "BANKNIFTY", "inst": "FUTIDX", "a3tkr": "BANKNIFTY-I", "sp": "0.00", "tk": 53734, "lot": 15 } ]


Sample Code


Python

Below is a sample Python script demonstrating how to interact with the ACCELPIX REST API using the requests library.

  1. import requests import urllib.parse # Base URL of the API url_base = "
  2. http://apidata.accelpix.in/api/fda/rest"
  3. # Your API token (URL-encoded) api_token = urllib.parse.quote("your_api_token_here") # EOD Data Request eod_url = f"{url_base}/nifty-1/20240116/20240118?api_token={api_token}" eod_response = requests.get(eod_url) print("EOD Data:", eod_response.json()) # Quotes Data Request quote_url = f"{url_base}/quote?api_token={api_token}" quotes = ["NIFTY-1", "NIFTY BANK"] quote_response = requests.post(quote_url, json=quotes) print("Quotes Data:", quote_response.json())


C# (.NET)

Below is a sample C# (.NET) console application demonstrating how to interact with the ACCELPIX REST API using HttpClient.

  1. // .NET using System; using System.Collections.Generic; using System.Net.Http; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; namespace AccelPixApiSample { class Program { static async Task Main(string[] args) { const string urlBase = "
  2. http://apidata.accelpix.in/api/fda/rest";
  3. var apiToken = Uri.EscapeDataString("your_api_token_here"); using (var client = new HttpClient()) { // EOD Data Request var eodUrl = $"{urlBase}/nifty-1/20240110/20240118?api_token={apiToken}"; var eodResponse = await client.GetStringAsync(eodUrl); Console.WriteLine("EOD Data: " + eodResponse); // Quotes Data Request var quoteUrl = $"{urlBase}/quote?api_token={apiToken}"; var symbols = new List<string> { "NIFTY-1", "NIFTY BANK" }; var jsonContent = JsonConvert.SerializeObject(symbols); var content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); var quoteResponse = await client.PostAsync(quoteUrl, content); var quoteResult = await quoteResponse.Content.ReadAsStringAsync(); Console.WriteLine("Quotes Data: " + quoteResult); } Console.ReadLine(); } } }

Ensure you have the Newtonsoft.Json package installed for JSON serialization.


    • Related Articles

    • Pix APIs - Realtime and Historical Data in Node.js

      Introduction Pix APIs is a robust JavaScript library designed to connect and stream market data efficiently. Utilizing WebSocket and fallback transport mechanisms, this library provides comprehensive functionalities to access both End of Day (EOD) ...
    • Pix APIs - Realtime and Historical Data in Python

      Introduction AccelPix Data API is a Python library designed to connect and stream market data seamlessly. Leveraging WebSocket and fallback transport mechanisms, this library provides functionalities to access both End of Day (EOD) and live streaming ...
    • How to configure Realtime NSE Data in Excel ?

      India's Fastest Realtime (Tick by Tick 1 Sec Updates) Data in MS Excel. The following are the minimum requirements: - 1. Microsoft Office Excel 2010 or above 2. Pix Connect Elite and the Above plans can be used with Excel. How to Setup Pix Connect ...
    • How to download Daily IEOD Incremental Data using Pix Connect ?

      Intraday End of Day Data ( IEOD ) is too crucial for backtesting purposes, that's why we do provide for all our subscribers at FREE OF COST with REALTIME Data Subscription. We are updating these data every day within 25 min after the market close (at ...
    • How to configure NinjaTrader 7 with Pix Connect ?

      njaTrader is the most renowned technical analysis platform and is used by over 50k + active Pro Traders all over the World. Here, we will show you how to configure Pix Connect with NinjaTrader 7? Before starting the Setup, we would have to install ...