API Version 2.0 has arrived!

Blog | PRODUCT UPDATE

Hello API users,

Upstox API — a product which launched mid last-year — has provided an amazing lot of benefits to traders who programme. It has helped them to back test their strategies and then set up a proper trading plan to cash in profits. A lot of things have been said and done, as the forum has always been vocal and kept us on our toes… thus pushing us to deliver. We thank all those users who helped us improvise and make this product better with each update. We have also seen some very senior API traders helping other traders get on track whenever they fell in an unknown zone or were lost midway.  

Things have been looking up in the past few months, and our number of users has gone up. So, it was important that we scale up the app and make it secure as well. Hence, we are releasing Upstox API, version 2.0. This version consists of a few path-breaking changes. And to stage this, we have hosted a new environment to keep the migration process swift. 

Version 2.0 is hosted on staging-api.upstox.com and the setup is live. We will be moving this setup to api.upstox.com on 21st January, 2019. You will get to see the following changes in the new setup:

Access token and socket creation 

Only one access token will be allowed at a time per API key. If you create a new access token, the previous token becomes invalid. Also, only one web socket can be created per access token. 

Note: If you want to create more than one app (API key) if need be, please visit the developer console

Symbol subscription 

Subscription of up to 500 symbols will be allowed in a session. We have also added an API to fetch the list of all the symbols subscribed (endpoints are available in the doc). 

Historical data

The performance of historical API has improved. Version 2.0 allows you to fetch data of the last seven days in a single request. However, you will be required to send more than one request if you need to pull data for more than seven days. Two new intervals of 3 minutes and 15 minutes have also been added to the list. Reference to the endpoint is available here.

Libraries of Python and NodeJS are updated. 

Rate limiting

We were very happy to get young and fresher API users on board. But sometimes, due to lack of experience, a tiny bug in their code have led to a lot of requests… resulting in flooding of the systems. Such instances affect other disciplined traders and puts them in a rather uncomfortable spot. To avoid such situations, we have implemented rate limiting for all APIs. You can check the limits here

Our main intention of releasing version 2.0 was to provide users with a richer and stable performance. The new version of API documentation is available here

We would remove the current version on 21st January, 2019. Our team will be available on the forum to get your questions answered.

Cheers, 

Team Upstox.

  • Sourav Basu Roy

    I don’t think these changes are going to help increase the ‘ease of use’ of this API.
    People generally hate having to rewrite already working code, frequent changes to the API will effect your customer base in the long run. Instead of limiting API use, increase your capacity.

  • Dining Philosopher

    Will the new changes break any existing APIs? I couldn’t find this in the documentation.

    • Orpheus Almeida

      Hi @diningphilosopher:disqus

      Yes a bit. There is a change in the endpoint for the historical API if your using it. Also check the rate limits we would be applying for each API, if they come in the way of your strategy execution.

      • Dining Philosopher

        Thanks. I am using the NodeJS library to make calls to the API. Will the NodeJS library I am using now for v1.0 work out-of-the-box for v2.0 without making any changes once you move the v2.0 to api.upstox.com?

        I have seen your new NodeJS library at https://upstox.com/forum/topic/2040/node-js-staging-setup-for-upstox-api/2.

        My question is: will the old NodeJS library also work?

  • Puneeth Dk

    when are you guys supporting calling your api using Java. Is it done? or how long we have to wait?