Stock   |   ETF   |   Index   |   Futures   |   Crypto   |   FX   |   Options

FirstRate Data OPTIONS API Documentation

The API provides customers with a lightweight method for accessing our datasets which can be integrated into custom workflows such as Python scripts.

Note - the API does not deliver raw data, only zip archives of csv files are served. You will need to uncompress the zip archive and iterate through the files in the archive.

Datasets are updated daily. The 'update' data (for past day, week or month) are available at 1am US Eastern Time for the prior day's trade data, whereas the full archives (containing the entire historical series) are available at 2am US Eastern Time.

All API functions are authenticated using your userid which is XXX.
Therefore all API requests need to be appended with the parameter userid=XXX as shown in the examples.


Details on the options dataset (file format, timezone etc) are available on the readme file at https://firstratedata.com/_readme/options.txt

API Functions

The API supports the below capabilities:

Historical Data Requests - (requesting the historical datafiles)

Last Update - (provides the last update date for the data. This is helpful for checking if there is fresh data available to request)

Ticker Listing - (provides the full listing of tickers as well as start and end dates)


Historical Data Requests

This function returns historical data archives (.txt files in csv format which are grouped into zip archives)

Url EndPoint : https://firstratedata.com/api/data_file

Requires Authentication : YES. All requests must include the parameter userid with your userid given to you in your signup email. Also available from your Customer Download Page.

Data Details : Full details on the data format, timezone, as well as available tickers and date ranges can be viewed on the bundle ReadMe Page

Parameters : The below parameters are used with the Url Endpoint to use the Historical Data Requests function:

Parameter : type

Accepted Values : stock , etf, futures , crypto , index , fx , options

Description : Specifies the type of instrument that is being requested.

Example :
https://firstratedata.com/api/data_file?type=options&year=2019&quarter=q3&userid=XXX

Parameter : period

Accepted Values : month , week , day

Description : This parameter is normally used to request a data update (for full archives use the 'year' + 'quarter' parameters to request a specific quarter).
'month' requests the last 30 days, 'week' requests the current trading week (starting on Monday), 'day' requests the last trading day.

Example :
https://firstratedata.com/api/data_file?type=options&period=week&userid=XXX

Parameter : quarter

Accepted Values : q1, q2, q3, q4

Description : Use the 'quarter' parameter in combination with the 'year' parameter to request a specific quarter/year of data

Example :
https://firstratedata.com/api/data_file?type=options&quarter=q2&year=2012&userid=XXX

Parameter : year

Accepted Values : year starting 2010

Description : Use the 'year' parameter in combination with the 'quarter' parameter to request a specific quarter/year of data

Example :
https://firstratedata.com/api/data_file?type=options&quarter=q2&year=2012&userid=XXX


Last Update

This function returns the last update for an instrument type. This function can be used to check whether there has been an update prior to executing data requests. Unlike data requests, this function returns raw data in the form of a date and not zip files.

Url EndPoint : https://firstratedata.com/api/last_update

Requires Authentication : YES. All requests must include the parameter userid with your userid given to you in your signup email. Also available from your Customer Download Page.

Parameters : The below parameters are used with the Url Endpoint to use the Last Update function:

Parameter : type

Accepted Values : stock , etf, futures , crypto , index , fx

Description : Specifies the type of instrument that is being requested.

Example :
https://firstratedata.com/api/last_update?type=options&userid=XXX