BondMetric API

Key Features

  • Files usually available by 7:00am EST
  • Files available for 30 days
  • Simple HTTP interface to retrieve files
  • Download files programmatically or with a web browser

Data Coverage

Global

Key Data Points

  • ISIN: ISIN number for the Bond. This is provided to customers who have ISIN license.
  • Entity Name: Entity Issuing the Bond
  • Credit Sector: Credit Sector of the Issuer
  • Country of Issuer: Country of Incorporation of the Issuer
  • Issue Date: Issue Date of the bond
  • Maturity Date: Maturity of the Bond
  • Coupon(%): Coupon defined for the Bond
  • Currency: Currency in which bond issue is traded/reported on a particular venue
  • FairValueDate: FairValue Pricing Date of the bond
  • ZSpread(%): Calculated Zspread
  • ASW(%): Calculated Asset Swap Spread
  • Clean Price: Clean Price Calculated by BVE
  • Dirty Price: Dirty Price calculated by BVE
  • Yield: Yield on the Bond if held to maturity (based on the Price)
  • Modified Duration: Modified Duration to Maturity
  • Macaulay Duration: Macaulay Duration to Maturity
  • Convexity: Bond Convexity to Maturity
  • Accrued Interest: Interest accrued on the bond since last coupon payment
  • BmkCountry: Country of Incorporation of Benchmark Bond
  • BmkIsin: ISIN number of Benchmark Bond
  • BmkYield: Calculated Yield of Benchmark Bond
  • BmkSpread: Calculated Spread of Benchmark Bond

API URL: https://api.bondmetric.com/api

Request Format

The request is passed in via HTTP request body. The only supported HTTP verb is POST/GET.

Example Query String https://api.bondmetric.com/api?token=XXXXXXXXXXXXXXXX&ISIN=IT0006703208&fair_value_date=2019-01-14

Input Parameters

Fields Name Type Format Mandatory Sample
token String Mandatory token=your_api_key
ISIN String Optional ISIN=IT0006703208
fair_value_date String YYYY-MM-DD Mandatory fair_value_date=2019-01-14

Response Format

Type Example
JSON
{
	"status": "ok",
	"code": 200,
	"count": 1,
	"message": "Data found",
	"data": [{
		"ISIN": "IT0006703208",
		"Entity Name": "Barclays Bank PLC",
		"Credit Sector": "Banks",
		"Country of Issuer": "United Kingdom",
		"Issue Date": "2009-08-06",
		"Maturity Date": "2019-07-21",
		"Coupon(%)": "6.000",
		"Currency": "EUR",
		"FairValue Date": "2019-01-14",
		"ZSpread(%)": "0.458",
		"ASW(%)": "0.479",
		"Clean Price": "103.047",
		"Dirty Price": "105.931",
		"Yield": "0.096",
		"Modified Duration": "0.516",
		"Macaulay Duration": "0.517",
		"Convexity": "0.782",
		"Accrued Interest": "2.883",
		"BmkCountry": "Germany",
		"BmkIsin": "",
		"BmkYield": "",
		"BmkSpread": "1.568"
	}]
}
            

Output

Fields Name Type Format
ISIN String
EntityName String
CreditSector String
CountryofIssuer String
IssueDate Date YYYY-MM-DD
MaturityDate Date YYYY-MM-DD
Coupon(%) String
Currency String
FairValueDate Date YYYY-MM-DD
ZSpread(%) String
ASW(%) String
CleanPrice String
DirtyPrice String
Yield String
ModifiedDuration String
MacaulayDuration String
Convexity String
AccruedInterest String
BmkCountry Float
BmkIsin String
BmkYield String
BmkSpread String

Status Code

Code Description
200 Request and Response success
400 Request not Valid
401 The API_KEY is invalid.
402 Invalid request method
403 Too many request
500 Internal Server Error

PHP

$url = "https://api.bondmetric.com/api";
$post = "token=XXXXXXXXXXXXXXX&ISIN=IT0006703208&fair_value_date=2019-01-14";

$curl = curl_init();	
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,false);
$content=curl_exec($curl);
curl_close($curl);

//print JSON data 
echo $content;

Java

package javaapplication1;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.logging.Level;
import java.util.logging.Logger;

public class JavaApplication1 {
    
    public static void main(String[] args) {
        HttpURLConnection connection = null;
        String urlParameters = null;
        try {
            urlParameters = "token=" + URLEncoder.encode("xxxxxxxxTOKENxxxxxxxxxxxx", "UTF-8")+
                    "&ISIN=" + URLEncoder.encode("IT0006703208", "UTF-8")+
					"&fair_value_date=" + URLEncoder.encode("2019-01-14", "UTF-8");
        } catch (UnsupportedEncodingException ex) {
            Logger.getLogger(JavaApplication1.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        try {
        //Create connection
        URL url = new URL("https://www.caalerts.com/api/api.php");
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

        //connection.setRequestProperty("Content-Length", Integer.toString(urlParameters.getBytes().length));
        connection.setRequestProperty("Content-Language", "en-US");  

        connection.setUseCaches(false);
        connection.setDoOutput(true);

        //Send request
        DataOutputStream wr = new DataOutputStream (
            connection.getOutputStream());
        wr.writeBytes(urlParameters);
        wr.close();

        //Get Response  
        InputStream is = connection.getInputStream();
        BufferedReader rd = new BufferedReader(new InputStreamReader(is));
        StringBuilder response = new StringBuilder(); // or StringBuffer if Java version 5+
        String line;
        while ((line = rd.readLine()) != null) {
          response.append(line);
          response.append('\r');
        }
        rd.close();
        System.out.println(response.toString());
      } 
      catch (Exception e) {
          
      } 
        finally {
        if (connection != null) {
          connection.disconnect();
        }
      }
    }
}

Find Out More

If you want more information on our products or have a general enquiry, please contact us.