Hello team how to bypass the TOP=10,000 limit in Workspace API CODEBK?

import refinitiv.data as rd
rd.open_session()

rd.discovery.search(
view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,
top = 10000,
filter = "((DbType eq 'GOVT' or DbType eq 'CORP' or DbType eq 'AGNC' or DbType eq 'OMUN' or DbType eq 'OTHR') and IsActive eq true and (RCSCountryGenealogy in ('G:DE')))",
select = "RIC,EJVAssetID,DTSubjectName,BusinessEntity,PI,SearchAllCategoryv3,SearchAllCategoryv2,SearchAllCategory,DBSTicker,CouponRate,MaturityDate,IssueDate,ISIN,RCSCurrencyLeaf,RCSCountryLeaf,DbTypeDescription,InstrumentTypeDescription,RCSCouponTypeGenealogy,FaceIssuedUSD,RCSBondGradeLeaf,RCSCountryGenealogy"
)

We have found link

How to aggregate Amount Outstanding based on Issue Rating for all US Municipal Bonds using python? — LSEG Developer Community 

but we are able to get it can you give us a sample code for for getting all US and Canadian bonds?

Answers

  • Hello @Marc_Belen24

    The user will need to do paging to retrieve more result set. The use of top and skip parameters in the API call and do repeated calls until all the results are retrieved.

    • top: The maximum number of documents to retrieve. Must be non-negative.
      • Type: int
      • Optional: Yes
    • skip: The number of documents to skip in the sorted result set before returning the next top.
      • Type: int
      • Optional: Yes

    PS: Its important to pace out the requests to avoid being throttled down due to too many requests.

    See the complete API usage and parameters in the LD Library example.