Introduction
Welcome to the RiskSpan API! You can use our API to access RiskSpan Edge Service.
We have language bindings in Shell. You can view code examples in the dark area to the right.
Authentication
To check if your API key is valid, use this code:
# With shell, you can just pass the correct header with each request
curl -X GET "https://edgeapi.riskspan.com:/RSRiskRest/RiskService/CheckAPIKey?ticket=CwDftresw"
The above command returns a Valid/Invalid response as below:
Unauthorized -- Invalid Auth Key
OR
Authorized -- Valid Auth Key
Make sure to replace
CwDftreswwith your API key.
RiskSpan uses API keys to allow access to the API. Please contact techsupport@riskspan.com to request your API key.
RiskSpan expects for the API key to be included in all API requests to the server in a header that looks similar to following:
ticket: CwDftresw
Run Edge Query
curl -X GET "https://edgeapi.riskspan.com:/RSEdgeRest/Edge/EdgeService?deal_name=_FNMA&trade_date=20180619&auth_key=your_api_key=&bucket_file=<NewBucketingFile><Dataset Value="_FNMA" /><Bucket Type="FactorDate" Min="20150101" Max="20150201" /></NewBucketingFile>"
The above command returns a json response structured like this:
{"CollateralResults":{"MainRequestId":28,"TimeStamp":"Wed Jun 20 10:11:11 2018","LoanBucketing":{"LoanBucket":{"AdjCPR":11.679738,"ScheduledBalance":4.989962056645125E12,"CPR":11.679556,"RemTerm":272.494025,"ServAdjCPR":11.740734,"UPB":4.938582885707426E12,"FactorDate":2.0150101E7,"PoolAge":38.221564,"ServAdjCurrBal":4.912444481516092E12,"RefiIncentive":0.584711,"FICO":749.215355,"LTV":74.642495,"Vintage":2011,"AdjSMM":1.029668,"BalNoFICO":1.1380564699458984E10,"BalNoLTV":9.578821065980469E9,"ServAdjScheBal":4.96383834284552E12,"BzDays":20.99965,"ClusterName":"NOBUCKET","ActiveLoanCount":3.0990574E7,"CurrentCoupon":3.749736,"Age":39.496903,"NumberOfLoans":3.0993227E7,"OrigBal":1.774060493689208E13,"Coupon":3.797824,"FicoModBal":4.927202321007967E12,"SATO":0.185772,"GrossCpn":4.334448,"LtvModBal":4.929004064641445E12,"SMM":1.029651,"PreviousBalance":5.004239206197592E12,"PoolCount":857082,"UPB_Million":4938582.885707,"KEY":"NOBUCKET","AvgLoanSize":225469.083367}}}}
This endpoint will run your Edge query on the server.
HTTP Request
GET https://edgeapi.riskspan.com:/RSEdgeRest/Edge/EdgeService?deal_name=_FNMA&trade_date=20180619&auth_key=your_api_key=&bucket_file=<NewBucketingFile><Dataset Value="_FNMA" /><Bucket Type="FactorDate" Min="20150101" Max="20150201" /></NewBucketingFile>
Query Parameters
| Parameter | Default | Description |
|---|---|---|
| auth_key | Your personal API key obtained from RiskSpan | |
| deal_name | Dataset name , eg - _FNMA,_FHLMC,_GNMA1,_GNMA2,_FHLOAN,_FNLOAN,_GNLOAN,_G2LOAN,_FNPOOLAI,_FHPOOLAI,_GN1POOLAI,_GN2POOLAI,_FNLOANAI,_FHLOANAI,_GN1LOANAI,_GN2LOANAI | |
| trade_date | Set to any date. | |
| compression | false | true - Enables compression - Base64 encoded GZIP compressed response. Used when you have multiple levels of bucketing causing response size to be huge. |
| json_response | true | When set to false - returns XML response. |
| bucket_file | false | The query to run. This has the buckets based on which you want to aggregate. |
View loan-level details for a given bucket
curl -X GET "https://edgeapi.riskspan.com:/RSEdgeRest/Edge/EdgeService?deal_name=_FNMA&trade_date=20170501&auth_key=your_api_key==&bucket_file=<NewBucketingFile><Dataset Value="_FNMA"/><Bucket Type="Term" Value="30" FilterFlag="1"/><Bucket Type="PoolType" Value="GEN" FilterFlag="1"/><Bucket Type="FactorDate" Min="20120101" Max="20171201" Step="1"/><Bucket Type="Vintage" Min="2010" Max="2010"/><Bucket Type="Coupon" Min="4.0" Max="4.0"/></NewBucketingFile>&loan_data=1&bucket_key=FactorDate_Bucket:20160101;Coupon_Bucket:4.00"
The above command returns a JSON strucutured like this:
{"CollateralResults":{"MainRequestId":28,"TimeStamp":"Wed Jun 20 10:11:11 2018","LoanBucketing":{"LoanBucket":{"AdjCPR":11.679738,"ScheduledBalance":4.989962056645125E12,"CPR":11.679556,"RemTerm":272.494025,"ServAdjCPR":11.740734,"UPB":4.938582885707426E12,"FactorDate":2.0150101E7,"PoolAge":38.221564,"ServAdjCurrBal":4.912444481516092E12,"RefiIncentive":0.584711,"FICO":749.215355,"LTV":74.642495,"Vintage":2011,"AdjSMM":1.029668,"BalNoFICO":1.1380564699458984E10,"BalNoLTV":9.578821065980469E9,"ServAdjScheBal":4.96383834284552E12,"BzDays":20.99965,"ClusterName":"NOBUCKET","ActiveLoanCount":3.0990574E7,"CurrentCoupon":3.749736,"Age":39.496903,"NumberOfLoans":3.0993227E7,"OrigBal":1.774060493689208E13,"Coupon":3.797824,"FicoModBal":4.927202321007967E12,"SATO":0.185772,"GrossCpn":4.334448,"LtvModBal":4.929004064641445E12,"SMM":1.029651,"PreviousBalance":5.004239206197592E12,"PoolCount":857082,"UPB_Million":4938582.885707,"KEY":"NOBUCKET","AvgLoanSize":225469.083367}}}}
This endpoint retrieves loan-level details for a given bucket.
HTTP Request
GET https://edgeapi.riskspan.com:/RSEdgeRest/Edge/EdgeService?deal_name=_FNMA&trade_date=20170501&auth_key=your_api_key==&bucket_file=<NewBucketingFile><Dataset Value="_FNMA"/><Bucket Type="Term" Value="30" FilterFlag="1"/><Bucket Type="PoolType" Value="GEN" FilterFlag="1"/><Bucket Type="FactorDate" Min="20120101" Max="20171201" Step="1"/><Bucket Type="Vintage" Min="2010" Max="2010"/><Bucket Type="Coupon" Min="4.0" Max="4.0"/></NewBucketingFile>&loan_data=1&bucket_key=FactorDate_Bucket:20160101;Coupon_Bucket:4.00
Query Parameters
| Parameter | Default | Description |
|---|---|---|
| auth_key | Your personal API key obtained from RiskSpan | |
| deal_name | Dataset name , eg - _FNMA,_FHLMC,_GNMA1,_GNMA2,_FHLOAN,_FNLOAN,_GNLOAN,_G2LOAN,_FNPOOLAI,_FHPOOLAI,_GN1POOLAI,_GN2POOLAI,_FNLOANAI,_FHLOANAI,_GN1LOANAI,_GN2LOANAI | |
| trade_date | Set to any date. | |
| compression | false | true - Enables compression - Base64 encoded GZIP compressed response. Used when you have multiple levels of bucketing causing response size to be huge. |
| json_response | true | When set to false - returns XML response. |
| bucket_file | The query to run. This has the buckets based on which you want to aggregate. | |
| loan_data | 0 | Please set to 1 for retreiving loan-level details. |
| bucket_key | Specify the bucket for which you want to retrieve loan-level details. You can find this in running a Edge query without loan-data. |
Errors
The RiskSpan API uses the following error codes:
| Error Code | Meaning |
|---|