Error in Market time series API

Hi,

I went through the documentation and I learnt that programatically I have to generate jKey before I can use any of the APIs. I used the login API to generate the jKey.

After generating the jKey, I executed the firstock_TimePriceSeries API by adding the jKey to the request message as documented in the link - Day Interval | Firstock

But I am ran into the following error :
timePriceSeries = thefirstock.firstock_TimePriceSeries(
TypeError: firstock_TimePriceSeries() got an unexpected keyword argument ‘jKey’

I figured I missed userId and added userId to the function call but I ran into the following error :
timePriceSeries = thefirstock.firstock_TimePriceSeries(
TypeError: firstock_TimePriceSeries() got an unexpected keyword argument ‘userId’

Now I am not sure how to proceed here. Kindly provide some information on how to call the APIs in Python.

Hi Team

Any update on the issue ?

Hi SH1287,

We shall send you a sample by tomorrow morning. Thank you for you’re patience.

Hi Team

Waiting for sample code

Hi Team

Waiting for sample code

Dear SH1287,

I understand that you have been facing some issues while making API calls using the thefirstock Python library. I’m here to provide you with a solution and guide you on how to proceed with the API calls successfully.

To begin with, please ensure you have the thefirstock Python library installed and imported in your project. If not, you can install it using pip:

pip install thefirstock

Next, you need to generate a jKey by using the login API. I can see that you have already tried to do that, but you encountered some errors. To fix this, please ensure you are passing the correct parameters while calling the firstock_login function. The required parameters are userId, password, TOTP, vendorCode, and apiKey.

from thefirstock import thefirstock

login = thefirstock.firstock_login(
    userId='YourUserIDHere',
    password='YourPasswordHere',
    TOTP='YourTOTPHere',
    vendorCode='YourVendorCodeHere',
    apiKey='YourAPIKeyHere',
)

After successful login, the jKey will be saved in a file, and you won’t need to pass it explicitly to other API calls. The library will automatically pick up the jKey and userId for you.

Now, let’s move on to the firstock_TimePriceSeries API call. Make sure you provide the necessary arguments such as exchange, token, startTime, endTime, and interval.

timePriceSeries = thefirstock.firstock_TimePriceSeries(
    exchange="NSE",
    token="RELIANCE-EQ",
    startTime="16/08/2022 09:45:32",
    endTime="15/02/2023 13:45:32",
    interval="DAY"
)

By following this approach, you should be able to make successful API calls using the thefirstock Python library. If you encounter any further issues or have any questions, please don’t hesitate to reach out to us for assistance.Thank you for your patience.

Hi ,


I am unable to open Api url and web socket url link which is given in the connect.firstock documentation section.
please help me

Hi @Raghu_Raju ,

Please use this URL to fetch the API documentation.

Hi Raghu

Thanks a lot. We will check and let you know if we face any issues.