Action Required: cmd Field in API to be Deprecated
Back

Action Required: cmd Field in API to be Deprecated

Fyers Web
Extended to 28th March 2024
23 February '2024
06:00 PM

Kindly note that the 'cmd' field in the API response, which you may currently be using, will be deprecated effective from 28th March 2024. It is crucial for you to update your systems and processes to align with the new API response format that will no longer include the 'cmd' field. This change is part of our commitment to improving our service offerings and enhancing our data handling efficiency. To understand the changes, refer to the below image:

All API users must prioritize this update to ensure a seamless transition.

If you have any concerns or require assistance, kindly contact us.

Updated on 27th February 2024: The deadline for deprecating the 'cmd' field has been extended to 28th March 2024. The 1st deadline was 1st March 2024.

Alternative Solution:

For those seeking an alternative method post-deprecation, please consider implementing the sample Python code provided below. This example demonstrates how to use the FYERS API to obtain the current minute partial candle data:


from fyers_apiv3 import fyersModel
from datetime import datetime

client_id = "XXXXXX"
access_token = "eyJ0eXXXXXXXX2c5-Y3RgS8wR14g"

fyers = fyersModel.FyersModel(client_id=client_id, token=access_token, log_path="/home/ec2-user/logs")

now = int(datetime.timestamp(datetime.now()))
print(now)
now -= now % 60
from_time = str(now)

data = {
    "symbol": "NSE:USDINR24MARFUT",
    "resolution": "1",
    "date_format": "0",
    "range_from": from_time,
    "range_to": from_time,
    "cont_flag": "1"
}

response = fyers.history(data=data)
print(response)

Note: We strongly advise testing this solution extensively before the final deprecation date and prior to deploying it in a live environment. This ensures compatibility and functionality align with your requirements.

icon-5-minutes

Open Your Demat Account in Under 5 Minutes

Have any queries? Get support icon-link-next