Overview
Resolve bond identifiers (CUSIP, ISIN) or free-text descriptions to structured bond data. Useful for looking up bonds by CUSIP or matching user queries to specific instruments.
Request
Free-text search query. Example: RIG 8% 2027
Exact CUSIP lookup. Example: 893830AK8
Exact ISIN lookup. Example: US893830AK85
Filter by company ticker. Example: RIG
Filter by coupon rate (%). Example: 8.0
Filter by maturity year. Example: 2027
Match mode: exact or fuzzy
Maximum number of matches.
Response
Array of matching bonds with confidence scores.
Whether an exact match was found.
Helpful suggestions if no exact match.
Examples
Free-Text Query
curl "https://api.debtstack.ai/v1/bonds/resolve?q=RIG%208%25%202027" \
-H "X-API-Key: ds_xxxxx"
Response
{
"data" : {
"query" : "RIG 8% 2027" ,
"matches" : [
{
"confidence" : 0.95 ,
"bond" : {
"id" : "uuid-123" ,
"name" : "8.00% Senior Notes due 2027" ,
"cusip" : "893830AK8" ,
"isin" : "US893830AK85" ,
"company_ticker" : "RIG" ,
"company_name" : "Transocean Ltd." ,
"coupon_rate" : 8.0 ,
"maturity_date" : "2027-02-01" ,
"seniority" : "senior_unsecured" ,
"outstanding" : 68810000000
}
}
],
"exact_match" : false ,
"suggestions" : []
}
}
CUSIP Lookup
curl "https://api.debtstack.ai/v1/bonds/resolve?cusip=893830AK8" \
-H "X-API-Key: ds_xxxxx"
Response:
{
"data" : {
"query" : "893830AK8" ,
"matches" : [
{
"confidence" : 1.0 ,
"bond" : {
"id" : "uuid-123" ,
"name" : "8.00% Senior Notes due 2027" ,
"cusip" : "893830AK8" ,
"isin" : "US893830AK85" ,
"company_ticker" : "RIG" ,
"company_name" : "Transocean Ltd." ,
"coupon_rate" : 8.0 ,
"maturity_date" : "2027-02-01" ,
"seniority" : "senior_unsecured" ,
"issuer" : {
"name" : "Transocean International Limited" ,
"entity_type" : "finco"
},
"guarantor_count" : 5 ,
"outstanding" : 68810000000
}
}
],
"exact_match" : true
}
}
Handling Fuzzy Matches
When the query is ambiguous, multiple matches may be returned:
curl "https://api.debtstack.ai/v1/bonds/resolve?q=AAPL%205%25" \
-H "X-API-Key: ds_xxxxx"
Response:
{
"data" : {
"query" : "AAPL 5%" ,
"matches" : [
{
"confidence" : 0.85 ,
"bond" : {
"name" : "4.65% Notes due 2046" ,
"cusip" : "037833CP8" ,
"coupon_rate" : 4.65 ,
"maturity_date" : "2046-02-23"
}
},
{
"confidence" : 0.80 ,
"bond" : {
"name" : "4.50% Notes due 2036" ,
"cusip" : "037833CQ6" ,
"coupon_rate" : 4.50 ,
"maturity_date" : "2036-02-23"
}
}
],
"exact_match" : false ,
"suggestions" : [
"Be more specific with maturity year"
]
}
}
Use Cases
def get_cusip ( query ):
"""Convert user query to CUSIP."""
response = requests.get(
f " { BASE_URL } /bonds/resolve" ,
params = { "q" : query, "limit" : 1 },
headers = { "X-API-Key" : API_KEY }
)
matches = response.json()[ "data" ][ "matches" ]
if matches and matches[ 0 ][ "confidence" ] > 0.8 :
return matches[ 0 ][ "bond" ][ "cusip" ]
return None
# Usage
cusip = get_cusip( "RIG 8% 2027" )
print (cusip) # "893830AK8"
Validate CUSIP
def validate_cusip ( cusip ):
"""Check if CUSIP exists in database."""
response = requests.get(
f " { BASE_URL } /bonds/resolve" ,
params = { "cusip" : cusip},
headers = { "X-API-Key" : API_KEY }
)
return response.json()[ "data" ][ "exact_match" ]
# Usage
is_valid = validate_cusip( "893830AK8" )
print (is_valid) # True