curl --request POST \
--url https://terrapinfinance.com/api/v1/agency_search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"isins": [
"US3134HCZH51"
]
}
'import requests
url = "https://terrapinfinance.com/api/v1/agency_search"
payload = { "isins": ["US3134HCZH51"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({isins: ['US3134HCZH51']})
};
fetch('https://terrapinfinance.com/api/v1/agency_search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://terrapinfinance.com/api/v1/agency_search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'isins' => [
'US3134HCZH51'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://terrapinfinance.com/api/v1/agency_search"
payload := strings.NewReader("{\n \"isins\": [\n \"US3134HCZH51\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://terrapinfinance.com/api/v1/agency_search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"isins\": [\n \"US3134HCZH51\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://terrapinfinance.com/api/v1/agency_search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"isins\": [\n \"US3134HCZH51\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"interest_rate": 5.2,
"interest_type": "fixed rate",
"is_callable": true,
"isin": "US3134HCZH51",
"issuer_name": "FEDERAL HOME LOAN MORTGAGE CORPORATION",
"maturity_date": "2056-03-16",
"ticker": "FHLMC 5.2 03/16/56"
}
],
"next_cursor": null,
"total": 1
}{
"errors": [
{
"detail": "Unauthorized",
"reason": "Your account tier does not allow this operation. Contact team@terrapinfinance.com for an upgrade."
}
]
}{
"errors": [
{
"detail": "Payment Required",
"reason": "You have run out of your granted quota for this resource as defined by your account tier. Contact team@terrapinfinance.com for an upgrade."
}
]
}{
"errors": [
{
"detail": "Forbidden",
"reason": "Your account tier does not allow this operation. Contact team@terrapinfinance.com for an upgrade."
}
]
}{
"errors": [
{
"detail": "Invalid string. Got: integer",
"source": {
"pointer": "/isins/0"
},
"title": "Invalid value"
}
]
}{
"errors": [
{
"detail": "Too Many Requests",
"reason": "<string>"
}
]
}{
"errors": [
{
"detail": "Internal Server Error",
"reason": "<string>"
}
]
}Bond Search
This endpoint returns a list of US agency bonds with a small set of fields. It is intended for search according to the filters provided.
curl --request POST \
--url https://terrapinfinance.com/api/v1/agency_search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"isins": [
"US3134HCZH51"
]
}
'import requests
url = "https://terrapinfinance.com/api/v1/agency_search"
payload = { "isins": ["US3134HCZH51"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({isins: ['US3134HCZH51']})
};
fetch('https://terrapinfinance.com/api/v1/agency_search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://terrapinfinance.com/api/v1/agency_search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'isins' => [
'US3134HCZH51'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://terrapinfinance.com/api/v1/agency_search"
payload := strings.NewReader("{\n \"isins\": [\n \"US3134HCZH51\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://terrapinfinance.com/api/v1/agency_search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"isins\": [\n \"US3134HCZH51\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://terrapinfinance.com/api/v1/agency_search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"isins\": [\n \"US3134HCZH51\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"interest_rate": 5.2,
"interest_type": "fixed rate",
"is_callable": true,
"isin": "US3134HCZH51",
"issuer_name": "FEDERAL HOME LOAN MORTGAGE CORPORATION",
"maturity_date": "2056-03-16",
"ticker": "FHLMC 5.2 03/16/56"
}
],
"next_cursor": null,
"total": 1
}{
"errors": [
{
"detail": "Unauthorized",
"reason": "Your account tier does not allow this operation. Contact team@terrapinfinance.com for an upgrade."
}
]
}{
"errors": [
{
"detail": "Payment Required",
"reason": "You have run out of your granted quota for this resource as defined by your account tier. Contact team@terrapinfinance.com for an upgrade."
}
]
}{
"errors": [
{
"detail": "Forbidden",
"reason": "Your account tier does not allow this operation. Contact team@terrapinfinance.com for an upgrade."
}
]
}{
"errors": [
{
"detail": "Invalid string. Got: integer",
"source": {
"pointer": "/isins/0"
},
"title": "Invalid value"
}
]
}{
"errors": [
{
"detail": "Too Many Requests",
"reason": "<string>"
}
]
}{
"errors": [
{
"detail": "Internal Server Error",
"reason": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Maximum interest rate of the agency bond (in percentage). Only matches bonds with a fixed, numeric interest rate.
Minimum interest rate of the agency bond (in percentage). Only matches bonds with a fixed, numeric interest rate.
The next_cursor of the previous page. Leave out, or send null, for the first page. Only cursor and limit may change between pages. See Pagination.
Return full reference data as in from /api/v1/agency_reference. This option requires a special account tier.
Types of interest:
fixed rate: The bond pays a fixed interest rate throughout its life.zero rate / discount rate: A bond that does not pay or accrue interest.variable rate: The bond's interest rate can change over time, typically based on a reference rate or formula (e.g., SOFR, CPI).step rate: The bond's interest rate increases ("steps up") at predetermined intervals.fixed to float: The bond pays a fixed coupon for an initial period, then floats with a reference rate.float to fixed: The bond pays a floating coupon for an initial period, then converts to a fixed rate.
fixed rate, fixed to float, float to fixed, step rate, variable rate, zero rate / discount rate Filter by whether the bond is callable.
International Securities Identification Number (ISIN), unique 12-character code for the security.
12Maximum issue date of the agency bond in ISO-8601 format (YYYY-MM-DD).
Minimum issue date of the agency bond in ISO-8601 format (YYYY-MM-DD).
Maximum size of total amount issued (in nominal value).
x >= 0Minimum size of total amount issued (in nominal value).
x >= 0Name of the issuing agency.
FEDERAL HOME LOAN MORTGAGE CORPORATION, FEDERAL NATIONAL MORTGAGE ASSOCIATION Number of results per page. A limit of 0 returns only total, the number of matching results.
x >= 0Maximum maturity date of the agency bond in ISO-8601 format (YYYY-MM-DD).
Minimum maturity date of the agency bond in ISO-8601 format (YYYY-MM-DD).
Deprecated, will be removed on April 2, 2027. Use cursor instead, see Pagination. Number of results to skip. Can't be combined with cursor unless 0.
x >= 0Fields to sort by. Prefix a field with '-' for descending order. Results with no value come last. See Order for how ties are broken.
-interest_rate, -interest_type, -is_callable, -isin, -issuer_name, -maturity_date, -ticker, interest_rate, interest_type, is_callable, isin, issuer_name, maturity_date, ticker Optional filter to only return bonds whose reference data has been updated since the given UTC instant.
Accepts an ISO-8601 date-time (YYYY-MM-DDThh:mm:ssZ), which is recommended since reference data can be updated multiple times per day.
A plain ISO-8601 date (YYYY-MM-DD) is also accepted for backwards compatibility but is deprecated, as it only resolves to the start of that day (00:00:00 UTC).
Response
Partial reference data
