How to call count API Hits In DSS
Hello Team,
We want a better way to count API call hits, as One call, calls one more API call(As if Request_Url/nextlink is sent along with the result)
We use -
https://selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/ExtractWithNotes
&
https://selectapi.datascope.refinitiv.com/RestApi/v1/Search/FuturesAndOptionsSearch
Could you please guide and help on this.
Thank you,
Trisha Gehlot
Best Answer
-
Hello @trisha.gehlot
I do not think we have that kind of example. According to the Best Practices and Limits for LSEG DataScope Select document, the suggest limits for the REST API are as follow:
An application should count their requests and control the number of requests by itself.
0
Answers
-
Thank you for reaching out to us.
Please explain more about your requirement. You may need to contact the DSS support team directly via MyRefinitiv for more information as this forum is more for programming type queries.
The DSS provides the Usage and Quota APIs, as shown in the DSS REST API Reference Tree.
You may also refer to the LSEG DataScope Select Best Practices & Fair Usage Policy for more information.
0 -
Thank you @Jirapongse !!
Yes our query is regarding programming.
From Document - LSEG DataScope Select Best Practices & Fair Usage Policy
To keep a consistent tally of how many requests you have executing, we recommend that you consider a request to count against your tally as soon as you submit it, and that you do not consider it to be removed from that tally until you receive a status that the request has completed, failed, been rejected, or has been cancelled.So we want to count the request per minute.
0 -
Hello @trisha.gehlot,
The usage details are also available through REST API in case you want to access it programmatically. For the API calls with on-demand extraction, you can also use ExtractWithNotes endpoint, which will produce a summary report of all the data used like this:
Extraction Services Version 16.3.44775 (2a6cb5e55172), Built Dec 15 2022 23:00:22
User has overridden estimates broker entitlements.
Processing started at 16/01/2023 03:59:12 PM.
User ID: ****
Extraction ID: 2000000503421163
Correlation ID: CiD/****/AAAAAA.0852c8fa81b879e9/RA
Schedule: 0x0852c8fa81c879e9 (ID = 0x0000000000000000)
Input List (1 items): (ID = 0x0852c8fa81c879e9) Created: 16/01/2023 03:59:12 PM Last Modified: 16/01/2023 03:59:12 PM
Report Template (476 fields): _OnD_0x0852c8fa81c879e9 (ID = 0x0852c8fa81d879e9) Created: 16/01/2023 03:59:10 PM Last Modified: 16/01/2023 03:59:10 PM
Schedule dispatched via message queue (0x0852c8fa81c879e9)
Schedule Time: 16/01/2023 03:59:12 PM
Timeseries Date Range: 07/12/2019 to 07/12/2022
Column 'CIN Code' suppressed for lack of 'CIN Code' permission.
Column 'Pricing Method Code' suppressed for lack of 'Distribution Rights - Field only allowed through Fixed Income Analytics template' permission.
Column 'Pricing Method Code Description' suppressed for lack of 'Distribution Rights - Field only allowed through Fixed Income Analytics template' permission.
(ISN,DE0001135424,QR1,DE113542=QTX) is inactive.
Processing completed successfully at 16/01/2023 03:59:13 PM, taking 0.919 Secs.
Extraction finished at 16/01/2023 08:59:13 PM UTC, with servers: x16q14, ETS (0.2 secs), QSDHA1 (0.0 secs), QSHC15 (0.5 secs)
Usage Summary for User ****, Client ****, Template Type Price History
Base Usage
Instrument Instrument Terms Price
Count Type Subtype Source Source
------- ----------------------------------- ---------------------------- -------------- ----------------------------------------
1 Govt/Treasury/Central Bank N/A N/A
-------
1 Total instrument charged.
0 Instruments with no reported data.
=======
1 Instrument in the input list.
No Evaluated Pricing Service complex usage to report -- 1 Instrument in the input list had no reported data.0 -
Thank you for this info @Gurpreet!!
Also now I got a new idea to limit the API hits using something -
from ratelimit import limits, sleep_and_retry# 30 calls per minute
CALLS = 30
RATE_LIMIT = 60
Could you please guide if something like this, is good practice to be use?
Or do we have something like this specific to DSS?0 -
Hi @trisha.gehlot,
Its advisable to rate limit the calls, and if possible try to use an instrument list and a report template to extract the data. You can see the different limits in the best practice and limits document.
0 -
Thank you for your response @Gurpreet !!
With large amount of instruments, it was advised to use on-demand approach
Also could you please give any example code to use rate limit, as same API is called in multiple functions.
0 -
Hello Team
Could anyone please help with this query?
Thank you0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛