# nyfedapi
This repository contains a Python wrapper to easily retrieve data from the Federal Reserve Bank of New York (FRBoNY) official API in pandas format.
## Overview
The Markets Data APIs are provided to external users and applications to request data from the Federal Reserve Bank of New York. FRBoNY's API does not require tokens or registration, so feel free to use it immediately.
There are ten databases with their endpoints that the FRBoNY has exposed to the public:
- Agency Mortgage-Backed Securities Operations
- Central Bank Liquidity Swaps Operations
- Guide Sheets
- Primary Dealer Statistics
- Primary Dealer Statistics Market Share
- Reference Rates
- Repo and Reverse Repo Operations
- Securities Lending Operations
- System Open Market Account Holdings
- Treasury Securities Operations
## Requirements
- Python 3.9 or higher.
- Requests
- Pandas
## Installation
```terminal
pip install nyfedapi
```
## Agency Mortage-Backed Securities Operations
### ambs.latest
Returns the latest AMBS operation Announcements or Results for the current day.
```python
from nyfedapi import ambs
df = ambs.latest(operation, status, include)
```
#### Parameters
| Parameter | Type | Description |
|-------------|-------|-------------------------------------------------------------------------------------|
| `operation` | `str` | The operation type. Available values: ["all", "purchases", "sales", "roll", "swap"] |
| `status` | `str` | The operation status. Available values: ["announcements", "results"] |
| `include` | `str` | The level of details to include. Available values: ["summary", "details"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest AMBS operation announcements or results for the current day.
### ambs.results_last_two_weeks
Returns the last two weeks AMBS operations Results.
```python
from nyfedapi import ambs
df = ambs.results_last_two_weeks(operation, include)
```
#### Parameters
| Parameter | Type | Description |
|-------------|-------|-------------------------------------------------------------------------------------|
| `operation` | `str` | The operation type. Available values: ["all", "purchases", "sales", "roll", "swap"] |
| `include` | `str` | The level of details to include. Available values: ["summary", "details"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing the last two weeks AMBS operations results.
### ambs.results_last_number
Returns the last N number of AMBS operations Results.
```python
from nyfedapi import ambs
df = ambs.results_last_two_weeks(operation, include, number)
```
#### Parameters
| Parameter | Type | Description |
|-------------|-------|-------------------------------------------------------------------------------------|
| `operation` | `str` | The operation type. Available values: ["all", "purchases", "sales", "roll", "swap"] |
| `include` | `str` | The level of details to include. Available values: ["summary", "details"] |
| `number` | `int` | The last N amount of operations to return. |
#### Returns
- `pd.DataFrame`: A DataFrame containing the last N number of AMBS operations results.
### ambs.results_search
Returns AMBS operations Results.
```python
from nyfedapi import ambs
df = ambs.results_search(operation, include, **kwargs)
```
#### Parameters
| Parameter | Type | Description |
|--------------|-------|------------------------------------------------------------------------------------------------------------------------------|
| `operation` | `str` | The operation type. Available values: ["all", "purchases", "sales", "roll", "swap"] |
| `include` | `str` | The level of details to include. Available values: ["summary", "details"] |
| `start_date` | `str` | The start date (inclusive) from which to search. Format YYYY-MM-DD. |
| `end_date` | `str` | The end date (inclusive) up until which to search. Format YYYY-MM-DD. |
| `securities` | `str` | Filter by securities (Operation Method). Available values: ["Basket", "Coupon Swap", "Dollar Roll", "Specified Pool", "TBA"] |
| `cusip` | `str` | Only return operations which include the given CUSIP. Partial identifiers are accepted. |
| `desc` | `str` | Only return operations which include the given Security Description. Partial identifiers are accepted. |
#### Returns
- `pd.DataFrame`: A DataFrame containing the AMBS operations results.
## Central Bank Liquidity Swaps Operations
### fxs.latest
Returns the latest Liquidity Swaps operation Results posted on current day.
```python
from nyfedapi import fxs
df = fxs.latest(operation_type)
```
#### Parameters
| Parameter | Type | Description |
|------------------|-------|------------------------------------------------------------------------------------------|
| `operation_type` | `str` | The operation type to search for. Available values: ["all", "usdollar", "nonusdollar"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest Liquidity Swaps operation results posted on current day.
### fxs.last_number
Returns the last N number of Liquidity Swaps operations Results.
```python
from nyfedapi import fxs
df = fxs.last_number(operation_type, number)
```
#### Parameters
| Parameter | Type | Description |
|------------------|-------|----------------------------------------------------------------------------------------|
| `operation_type` | `str` | The operation type to search for. Available values: ["all", "usdollar", "nonusdollar"] |
| `number` | `int` | The last N amount of trades to return |
#### Returns
- `pd.DataFrame`: A DataFrame containing the last N number of Liquidity Swaps operations results.
### fxs.search
Returns Liquidity Swaps operation Results.
```python
from nyfedapi import fxs
df = fxs.search(operation_type, **kwargs)
```
#### Parameters
| Parameter | Type | Description |
|------------------|-------|----------------------------------------------------------------------------------------|
| `operation_type` | `str` | The operation type to search for. Available values: ["all", "usdollar", "nonusdollar"] |
| `start_date` | `str` | The start date (inclusive) from which to search, depending on date type. Defaults to current date. Format YYYY-MM-DD. |
| `end_date` | `str` | The end date (inclusive) up until which to search, depending on date type. Format YYYY-MM-DD. |
| `date_type` | `str` | The date type to search for within the start and end. Defaults to trade date. Available values : ["trade", "maturity"] |
| `counterparties` | `str` | A comma-separated list of counterparty names to search for. Partial names are accepted. |
#### Returns
- `pd.DataFrame`: A DataFrame containing Liquidity Swaps operation Results.
### fxs.counterparties
Returns Counterparties of Liquidity Swaps operations.
```python
from nyfedapi import fxs
df = fxs.counterparties()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing counterparties of Liquidity Swaps operations.
## Guide Sheets
### guidesheets.latest
Returns the latest Guide Sheet. Work in Progress (WIP).
```python
from nyfedapi import guidesheets
df = guidesheets.latest()
```
#### Parameters
| Parameter | Type | Description |
|------------------|-------|------------------------------------------------------------|
| `guidesheet_type` | `str` | The guide sheet type. Available values: ["si", "wi", "fs"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest Guide Sheet.
### guidesheets.previous
Returns the previous Guide Sheet. Work in Progress (WIP).
```python
from nyfedapi import guidesheets
df = guidesheets.previous()
```
#### Parameters
| Parameter | Type | Description |
|------------------|-------|------------------------------------------------------------|
| `guidesheet_type` | `str` | The guide sheet type. Available values: ["si", "wi", "fs"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest Guide Sheet.
## Primary Dealer Statistics
### pd.latest
Returns the latest Survey results for each timeseries.
```python
from nyfedapi import pd
df = pd.latest()
```
#### Parameters
| Parameter | Type | Description |
|---------------|-------|-----------------------------|
| `seriesbreak` | `str` | A valid series break value. |
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest Survey results for each timeseries.
### pd.get_all_timeseries
Returns all Survey results.
```python
from nyfedapi import pd
df = pd.get_all_timeseries()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing all Survey results.
### pd.list_timeseries
Returns Description of timeseries/keyids.
```python
from nyfedapi import pd
df = pd.list_timeseries()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing description of timeseries/keyids.
### pd.list_asof
Returns all As Of Dates with respective Series Break.
```python
from nyfedapi import pd
df = pd.list_asof()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing all as of dates with respective series break.
### pd.list_seriesbreaks
Returns Series Breaks including Label, Start and End Date.
```python
from nyfedapi import pd
df = pd.list_seriesbreaks()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing series breaks including label, start and end date.
### pd.get_asof
Returns single date Survey results.
```python
from nyfedapi import pd
df = pd.get_asof()
```
#### Parameters
| Parameter | Type | Description |
|-----------|-------|------------------------------------------------|
| `date` | `str` | The time series as of date. Format YYYY-MM-DD. |
#### Returns
- `pd.DataFrame`: A DataFrame containing single date survey results.
### pd.get_timeseries
Return Survey results for given timeseries across all Series Breaks. To query multiple timeseries, separate each with underscore(_).
```python
from nyfedapi import pd
df = pd.get_timeseries()
```
#### Parameters
| Parameter | Type | Description |
|--------------|-------|-----------------------------------------------------|
| `timeseries` | `str` | A list of time series ids separated by underscores. |
#### Returns
- `pd.DataFrame`: A DataFrame containing survey results for given timeseries across all series breaks.
### pd.get_seriesbreaks_timeseries
Return Survey results for given timeseries across all Series Breaks. To query multiple timeseries, separate each with underscore(_).
```python
from nyfedapi import pd
df = pd.get_seriesbreaks_timeseries()
```
#### Parameters
| Parameter | Type | Description |
|----------------|-------|-----------------------------------------------------|
| `seriesbreaks` | `str` | A valid series break value. |
| `timeseries` | `str` | A list of valid time series separated with underscores. |
#### Returns
- `pd.DataFrame`: A DataFrame containing survey results for given timeseries across all series breaks.
## Primary Dealer Statistics Market Share
### marketshare.qtrly_latest
Returns the latest quarterly Market Share.
```python
from nyfedapi import marketshare
df = marketshare.qtrly_latest()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest quarterly market share.
### marketshare.ytd_latest
Returns the latest year-to-date Market Share.
```python
from nyfedapi import marketshare
df = marketshare.ytd_latest()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest year-to-date market share.
## Reference Rates
### rates.all_latest
Returns the latest secured and unsecured rates.
```python
from nyfedapi import rates
df = rates.all_latest()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest secured and unsecured rates.
### rates.all_search
Returns the latest secured and unsecured rates.
```python
from nyfedapi import rates
df = rates.all_search()
```
#### Parameters
| Parameter | Type | Description |
|--------------|-------|---------------------------------------------------------------------------------------------------|
| `start_date` | `str` | The start date (inclusive) from which to search. Defaults to the current date. Format YYYY-MM-DD. |
| `end_date` | `str` | The end date (inclusive) up until which to search. Format YYYY-MM-DD. |
| `type` | `str` | The report type to return. Available values : ["rate", "volume"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest secured and unsecured rates.
### rates.secured_all_latest
Returns the latest secured rates.
```python
from nyfedapi import rates
df = rates.secured_all_latest()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest secured rates.
### rates.secured_last_number
Returns the last N number of secured rates.
```python
from nyfedapi import rates
df = rates.secured_last_number(rate_type, number)
```
#### Parameters
| Parameter | Type | Description |
|-------------|-------|----------------------------------------------------------------------|
| `rate_type` | `str` | The rate type. Available values : ["tgcr", "bgcr", "sofr", "sofrai"] |
| `number` | `int` | The last N amount of rates to return. |
#### Returns
- `pd.DataFrame`: A DataFrame containing the last N number of secured rates.
### rates.secured_search
Returns secured rates and/or volume.
```python
from nyfedapi import rates
df = rates.secured_search(rate_type, **kwargs)
```
#### Parameters
| Parameter | Type | Description |
|--------------|-------|--------------------------------------------------------------------------------------------------|
| `rate_type` | `str` | The rate type. Available values : ["all", "tgcr", "bgcr", "sofr", "sofrai"] |
| `start_date` | `str` | The start date (inclusive) from which to search. Defaults to the current date. Format YYYY-MM-DD |
| `end_date` | `str` | The end date (inclusive) up until which to search. Format YYYY-MM-DD |
| `type` | `str` | The report type to return. Available values : ["rate", "volume"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing secured rates and/or volume.
### rates.unsecured_all_latest
Returns the latest unsecured rates.
```python
from nyfedapi import rates
df = rates.unsecured_all_latest()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest unsecured rates.
### rates.unsecured_last_number
Returns the last N number of unsecured rates.
```python
from nyfedapi import rates
df = rates.unsecured_last_number(rate_type, number)
```
#### Parameters
| Parameter | Type | Description |
|-------------|-------|-----------------------------------------------------|
| `rate_type` | `str` | The rate type. Available values : ["effr", "obfr"] |
| `number` | `int` | The last N amount of rates to return. |
#### Returns
- `pd.DataFrame`: A DataFrame containing the last N number of unsecured rates.
### rates.unsecured_search
Returns unsecured rates and/or volume.
```python
from nyfedapi import rates
df = rates.unsecured_search(rate_type, **kwargs)
```
#### Parameters
| Parameter | Type | Description |
|--------------|-------|---------------------------------------------------------------------------------------------------|
| `rate_type` | `str` | The rate type. Available values : ["all", "efr", "obfr"] |
| `start_date` | `str` | The start date (inclusive) from which to search. Defaults to the current date. Format YYYY-MM-DD. |
| `end_date` | `str` | The end date (inclusive) up until which to search. Format YYYY-MM-DD. |
| `type` | `str` | The report type to return. Available values : ["rate", "volume"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing unsecured rates and/or volume.
## Repo and Reverse Repo Operations
### rp.latest
Returns the latest Repo and/or Reverse Repo operations Announcements or Results for the current day.
```python
from nyfedapi import rp
df = rp.latest(operation_type, method, status)
```
#### Parameters
| Parameter | Type | Description |
|------------------|-------|---------------------------------------------------------------------------------|
| `operation_type` | `str` | The operation type. Available values : ["all", "repo", "reverserepo"] |
| `method` | `str` | The operation method. Available values : ["all", "fixed", "single", "multiple"] |
| `status` | `str` | The operation status. Available values : ["announcements", "results"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest repo and/or reverse repo operations announcements or results for the current day.
### rp.results_last_two_weeks
Returns the last two weeks Repo and/or Reverse Repo operations Results.
```python
from nyfedapi import rp
df = rp.results_last_two_weeks(operation_type, method)
```
#### Parameters
| Parameter | Type | Description |
|------------------|-------|---------------------------------------------------------------------------------|
| `operation_type` | `str` | The operation type. Available values : ["all", "repo", "reverserepo"] |
| `method` | `str` | The operation method. Available values : ["all", "fixed", "single", "multiple"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing the last two weeks repo and/or reverse repo operations results.
### rp.results_last_number
Returns the last N number of Repo and/or Reverse Repo operations Results.
```python
from nyfedapi import rp
df = rp.results_last_number(operation_type, method, number)
```
#### Parameters
| Parameter | Type | Description |
|------------------|-------|--------------------------------------------------------------------------------|
| `operation_type` | `str` | The operation type. Available values : ["all", "repo", "reverserepo"] |
| `method` | `str` | The operation method. Available values : ["all", "fixed", "single", "multiple"] |
| `number` | `int` | The last N amount of operations to return. |
#### Returns
- `pd.DataFrame`: A DataFrame containing the last N number of repo and/or reverse repo operations results.
### rp.results_search
Returns Repo and/or Reverse Repo operation Results.
```python
from nyfedapi import rp
df = rp.results_search(**kwargs)
```
#### Parameters
| Parameter | Type | Description |
|-------------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `start_date` | `str` | The start date (inclusive) from which to search. Format YYYY-MM-DD. |
| `end_date` | `str` | The end date (inclusive) up until which to search. Format YYYY-MM-DD. |
| `operation_types` | `str` | The operation types (comma-delimited) by which to filter. Available values : ["Repo", "Reverse Repo"] |
| `method` | `str` | The operation method by which to filter. Available values : ["multiple", "single", "fixed"] |
| `security_type` | `str` | The security type (tranche) by which to filter. For specific types, only operations which include that type will be returned. Available values : ["mbs", "agency", "tsy", "srf"] |
| `term` | `str` | The term of the operation. Available values : ["overnight", "term"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing repo and/or reverse repo operation results.
### rp.reverserepo_propositions_search
Returns Propositions for Reverse Repo operations.
```python
from nyfedapi import rp
df = rp.reverserepo_propositions_search(**kwargs)
```
#### Parameters
| Parameter | Type | Description |
|-------------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `start_date` | `str` | The start date (inclusive) from which to search. Format YYYY-MM-DD. |
| `end_date` | `str` | The end date (inclusive) up until which to search. Format YYYY-MM-DD. |
#### Returns
- `pd.DataFrame`: A DataFrame containing propositions for reverse repo operations.
## Securities Lending Operations
### seclending.results_latest
Returns the latest Securities Lending operation Results for the current day.
```python
from nyfedapi import seclending
df = seclending.results_latest(operation, include)
```
#### Parameters
| Parameter | Type | Description |
|-------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `operation` | `str` | The operation type. Available values : ["all", "seclending", "extensions"]. |
| `include` | `str` | The level of details to include. Available values : ["summary", "details"]. |
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest securities lending operation results for the current day.
### seclending.results_last_two_weeks
Returns the last two weeks Securities Lending operation Results and/or Extensions.
```python
from nyfedapi import seclending
df = seclending.results_last_two_weeks(operation, include)
```
#### Parameters
| Parameter | Type | Description |
|-------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `operation` | `str` | The operation type. Available values : ["all", "seclending", "extensions"]. |
| `include` | `str` | The level of details to include. Available values : ["summary", "details"]. |
#### Returns
- `pd.DataFrame`: A DataFrame containing the last two weeks securities lending operation results and/or extensions.
### seclending.results_last_number
Returns the last N number of Securities Lending operation Results and/or Extensions.
```python
from nyfedapi import seclending
df = seclending.results_last_number(operation, include, number)
```
#### Parameters
| Parameter | Type | Description |
|-------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `operation` | `str` | The operation type. Available values : ["all", "seclending", "extensions"]. |
| `include` | `str` | The level of details to include. Available values : ["summary", "details"]. |
| `number` | `int` | The last N amount of operations to return. |
#### Returns
- `pd.DataFrame`: A DataFrame containing the last N number of securities lending operation results and/or extensions.
### seclending.results_search
Returns Securities Lending operation Results and/or Extensions.
```python
from nyfedapi import seclending
df = seclending.results_search(operation, include)
```
#### Parameters
| Parameter | Type | Description |
|-------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `operation` | `str` | The operation type. Available values : ["all", "seclending", "extensions"]. |
| `include` | `str` | The level of details to include. Available values : ["summary", "details"]. |
#### Returns
- `pd.DataFrame`: A DataFrame containing securities lending operation results and/or extensions.
## System Open Market Account Holdings
### soma.asofdates_latest
Returns the latest SOMA holdings As Of Date.
```python
from nyfedapi import soma
df = soma.asofdates_latest()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest SOMA holdings As Of Date.
### soma.summary
Returns Summary Of SOMA holdings for each As of Date and holding type.
```python
from nyfedapi import soma
ndf = soma.summary()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing summary of SOMA holdings for each as of date and holding type.
### soma.asofdates_list
Returns all SOMA holdings As of Date.
```python
from nyfedapi import soma
df = soma.asofdates_list()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing all SOMA holdings as of date.
### soma.agency_get_release_log
Returns the last three months Agency Release and As Of Dates.
```python
from nyfedapi import soma
df = soma.agency_get_release_log()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing the last three months Agency release and as of dates.
### soma.agency_get_asof
Returns a single date SOMA Agency Holdings.
```python
from nyfedapi import soma
df = soma.agency_get_asof(date)
```
#### Parameters
| Parameter | Type | Description |
|-----------|-------|-----------------------------------------------------------------------------|
| `date` | `str` | The date for which to retrieve the agency release. Format YYYY-MM-DD. |
#### Returns
- `pd.DataFrame`: A DataFrame containing a single date SOMA Agency holdings.
### soma.agency_get_cusip
Returns all SOMA Agency Holdings for a single CUSIP.
```python
from nyfedapi import soma
df = soma.agency_get_cusip(cusip)
```
#### Parameters
| Parameter | Type | Description |
|----------|-------|-----------------------------------------------------------------------------|
| `cusip` | `str` | The CUSIP for which to retrieve information. |
#### Returns
- `pd.DataFrame`: A DataFrame containing all SOMA Agency Holdings for a single CUSIP.
### soma.agency_get_holdingtype_asof
Returns a single date SOMA Agency Holdings for a Agency holding type.
```python
from nyfedapi import soma
df = soma.agency_get_holdingtype_asof(holding_type, date)
```
#### Parameters
| Parameter | Type | Description |
|----------------|-------|-------------------------------------------------------------------------------------------------|
| `holding_type` | `str` | The holding type for which to retrieve. Available values: ["all", "agency debts", "mbs", "cmb"] |
| `date` | `str` | The date for which to retrieve the agency release. Format YYYY-MM-DD. |
#### Returns
- `pd.DataFrame`: A DataFrame containing a single date SOMA Agency holdings for a Agency holding type.
### soma.agency_wam_asof
Returns a single date Weighted Average Maturity for Agency Debt.
```python
from nyfedapi import soma
df = soma.agency_wam_asof(date)
```
#### Parameters
| Parameter | Type | Description |
|----------------|-------|-------------------------------------------------------------------------------------------------|
| `date` | `str` | The date for which to retrieve the Weighted Average Maturity number. Format YYYY-MM-DD. |
#### Returns
- `pd.DataFrame`: A DataFrame containing a single date Weighted Average Maturity for Agency Debt.
### soma.tsy_get_release_log
Returns the last three months Treasury Release and As Of Dates.
```python
from nyfedapi import soma
df = soma.tsy_get_release_log()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing the last three months Treasury release and as of dates.
### soma.tsy_get_asof
Returns a single date SOMA Treasury Holdings.
```python
from nyfedapi import soma
df = soma.tsy_get_asof(date)
```
#### Parameters
| Parameter | Type | Description |
|-----------|-------|-------------------------------------------------------------------------|
| `date` | `str` | The date for which to retrieve the treasury release. Format YYYY-MM-DD. |
#### Returns
- `pd.DataFrame`: A DataFrame containing a single date SOMA Treasury holdings.
### soma.tsy_get_cusip
Returns all SOMA Treasury Holdings for a single CUSIP.
```python
from nyfedapi import soma
df = soma.tsy_get_cusip(cusip)
```
#### Parameters
| Parameter | Type | Description |
|----------|-------|-----------------------------------------------------------------------------|
| `cusip` | `str` | The CUSIP for which to retrieve information. |
#### Returns
- `pd.DataFrame`: A DataFrame containing all SOMA Treasury Holdings for a single CUSIP.
### soma.tsy_get_holdingtype_asof
Returns a single date SOMA Treasury Holdings for a Treasury holding type.
```python
from nyfedapi import soma
df = soma.tsy_get_holdingtype_asof(holding_type, date)
```
#### Parameters
| Parameter | Type | Description |
|----------------|-------|---------------------------------------------------------------------------------------------------------|
| `holding_type` | `str` | The holding type for which to retrieve. Available values: ["all", "bills", "notesbonds", "frn", "tips"] |
| `date` | `str` | The date for which to retrieve the treasury release. Format YYYY-MM-DD. |
#### Returns
- `pd.DataFrame`: A DataFrame containing a single date SOMA Treasury Holdings for a Treasury holding type.
### soma.tsy_wam_holdingtype_asof
Returns a single date Weighted Average Maturity for a Treasury holding type.
```python
from nyfedapi import soma
ndf = soma.tsy_wam_holdingtype_asof(holding_type, date)
```
#### Parameters
| Parameter | Type | Description |
|----------------|-------|---------------------------------------------------------------------------------------------------------|
| `holding_type` | `str` | The holding type for which to retrieve. Available values: ["all", "bills", "notesbonds", "frn", "tips"] |
| `date` | `str` | The date for which to retrieve the Weighted Average Maturity number. Format YYYY-MM-DD. |
#### Returns
- `pd.DataFrame`: A DataFrame containing a single date Weighted Average Maturity for a Treasury holding type.
### soma.tsy_get_monthly
Returns all SOMA Treasury Holdings at monthly intervals.
```python
from nyfedapi import soma
df = soma.tsy_get_monthly()
```
#### Returns
- `pd.DataFrame`: A DataFrame containing all SOMA Treasury Holdings at monthly intervals.
## Treasury Securities Operations
### tsy.latest
Returns the latest Treasury operation Announcements or Results for the current day.
```python
from nyfedapi import tsy
df = tsy.latest(operation, status, include)
```
#### Parameters
| Parameter | Type | Description |
|-------------|-------|-------------------------------------------------------------------------------------|
| `operation` | `str` | The operation type. Available values: ["all", "purchases", "sales"] |
| `status` | `str` | The operation status. Available values: ["announcements", "results", "operations""] |
| `include` | `str` | The level of details to include. Available values: ["summary", "details"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing the latest Treasury operation announcements or results for the current day.
### tsy.results_last_two_weeks
Returns the last two weeks Treasury operations Results.
```python
from nyfedapi import tsy
df = tsy.results_last_two_weeks(operation, include)
```
#### Parameters
| Parameter | Type | Description |
|-------------|-------|-------------------------------------------------------------------------------------|
| `operation` | `str` | The operation type. Available values: ["all", "purchases", "sales"] |
| `include` | `str` | The level of details to include. Available values: ["summary", "details"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing the last two weeks Treasury operations results.
### tsy.results_last_number
Returns the last N number of Treasury operations Results.
```python
from nyfedapi import tsy
df = tsy.results_last_number(operation, include, number)
```
#### Parameters
| Parameter | Type | Description |
|-------------|-------|---------------------------------------------------------------------------|
| `operation` | `str` | The operation type. Available values: ["all", "purchases", "sales"] |
| `include` | `str` | The level of details to include. Available values: ["summary", "details"] |
| `number` | `int` | The last amount of results to return from current date. |
#### Returns
- `pd.DataFrame`: A DataFrame containing the last N number of Treasury operations Results.
### tsy.results_search
Returns Treasury operation Results.
```python
from nyfedapi import tsy
df = tsy.results_search(operation, include)
```
#### Parameters
| Parameter | Type | Description |
|-------------|-------|---------------------------------------------------------------------------|
| `operation` | `str` | The operation type. Available values: ["all", "purchases", "sales"] |
| `include` | `str` | The level of details to include. Available values: ["summary", "details"] |
#### Returns
- `pd.DataFrame`: A DataFrame containing Treasury operation results.
## TODO
- [ ] Add a keyword argument (kwargs) translator. Example: startDate -> start_date
- [ ] Implement the marketshare and guidesheets endpoints, as they currently do not support CSV format download.
- [ ] Issue with ```seclending.results_search()```: Although startDate and endDate are not required, omitting them results in a 404 error with the response: ["Cannot exceed allowed span of 1 year"].
- [ ] Issue with ```ambs.results_search()```: Although startDate and endDate are not required, omitting them results in a 404 error with the response: ["Cannot exceed allowed span of 2 years"].
## API Documentation
- [Markets Data APIs: Federal Reserve Bank of New York (FRBoNY)](https://markets.newyorkfed.org/static/docs/markets-api.html)
Raw data
{
"_id": null,
"home_page": "https://github.com/Jaldekoa/nyfedapi",
"name": "nyfedapi",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Jon Aldekoa",
"author_email": "jaldekoa@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/64/da/2e5904a927e7c4d4d6403a867268319f2d8f89a52f5eb495df85567f7315/nyfedapi-0.0.1.tar.gz",
"platform": "Any",
"description": "# nyfedapi\nThis repository contains a Python wrapper to easily retrieve data from the Federal Reserve Bank of New York (FRBoNY) official API in pandas format.\n\n## Overview\nThe Markets Data APIs are provided to external users and applications to request data from the Federal Reserve Bank of New York. FRBoNY's API does not require tokens or registration, so feel free to use it immediately.\n\nThere are ten databases with their endpoints that the FRBoNY has exposed to the public:\n\n- Agency Mortgage-Backed Securities Operations\n- Central Bank Liquidity Swaps Operations\n- Guide Sheets\n- Primary Dealer Statistics\n- Primary Dealer Statistics Market Share\n- Reference Rates\n- Repo and Reverse Repo Operations\n- Securities Lending Operations\n- System Open Market Account Holdings\n- Treasury Securities Operations\n\n## Requirements\n- Python 3.9 or higher.\n- Requests\n- Pandas\n\n## Installation\n```terminal\npip install nyfedapi\n```\n\n## Agency Mortage-Backed Securities Operations\n\n### ambs.latest\nReturns the latest AMBS operation Announcements or Results for the current day.\n\n```python\nfrom nyfedapi import ambs\ndf = ambs.latest(operation, status, include)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------|-------|-------------------------------------------------------------------------------------|\n| `operation` | `str` | The operation type. Available values: [\"all\", \"purchases\", \"sales\", \"roll\", \"swap\"] |\n| `status` | `str` | The operation status. Available values: [\"announcements\", \"results\"] |\n| `include` | `str` | The level of details to include. Available values: [\"summary\", \"details\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest AMBS operation announcements or results for the current day.\n\n\n### ambs.results_last_two_weeks\nReturns the last two weeks AMBS operations Results.\n\n```python\nfrom nyfedapi import ambs\ndf = ambs.results_last_two_weeks(operation, include)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------|-------|-------------------------------------------------------------------------------------|\n| `operation` | `str` | The operation type. Available values: [\"all\", \"purchases\", \"sales\", \"roll\", \"swap\"] |\n| `include` | `str` | The level of details to include. Available values: [\"summary\", \"details\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the last two weeks AMBS operations results.\n\n\n### ambs.results_last_number\nReturns the last N number of AMBS operations Results.\n\n```python\nfrom nyfedapi import ambs\ndf = ambs.results_last_two_weeks(operation, include, number)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------|-------|-------------------------------------------------------------------------------------|\n| `operation` | `str` | The operation type. Available values: [\"all\", \"purchases\", \"sales\", \"roll\", \"swap\"] |\n| `include` | `str` | The level of details to include. Available values: [\"summary\", \"details\"] |\n| `number` | `int` | The last N amount of operations to return. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the last N number of AMBS operations results.\n\n\n### ambs.results_search\nReturns AMBS operations Results.\n\n```python\nfrom nyfedapi import ambs\ndf = ambs.results_search(operation, include, **kwargs)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|--------------|-------|------------------------------------------------------------------------------------------------------------------------------|\n| `operation` | `str` | The operation type. Available values: [\"all\", \"purchases\", \"sales\", \"roll\", \"swap\"] |\n| `include` | `str` | The level of details to include. Available values: [\"summary\", \"details\"] |\n| `start_date` | `str` | The start date (inclusive) from which to search. Format YYYY-MM-DD. |\n| `end_date` | `str` | The end date (inclusive) up until which to search. Format YYYY-MM-DD. |\n| `securities` | `str` | Filter by securities (Operation Method). Available values: [\"Basket\", \"Coupon Swap\", \"Dollar Roll\", \"Specified Pool\", \"TBA\"] |\n| `cusip` | `str` | Only return operations which include the given CUSIP. Partial identifiers are accepted. |\n| `desc` | `str` | Only return operations which include the given Security Description. Partial identifiers are accepted. |\n\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the AMBS operations results.\n\n\n## Central Bank Liquidity Swaps Operations\n\n### fxs.latest\nReturns the latest Liquidity Swaps operation Results posted on current day.\n\n```python\nfrom nyfedapi import fxs\ndf = fxs.latest(operation_type)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|------------------|-------|------------------------------------------------------------------------------------------|\n| `operation_type` | `str` | The operation type to search for. Available values: [\"all\", \"usdollar\", \"nonusdollar\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest Liquidity Swaps operation results posted on current day.\n\n\n### fxs.last_number\nReturns the last N number of Liquidity Swaps operations Results.\n\n```python\nfrom nyfedapi import fxs\ndf = fxs.last_number(operation_type, number)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|------------------|-------|----------------------------------------------------------------------------------------|\n| `operation_type` | `str` | The operation type to search for. Available values: [\"all\", \"usdollar\", \"nonusdollar\"] |\n| `number` | `int` | The last N amount of trades to return |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the last N number of Liquidity Swaps operations results.\n\n\n### fxs.search\nReturns Liquidity Swaps operation Results.\n\n```python\nfrom nyfedapi import fxs\ndf = fxs.search(operation_type, **kwargs)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|------------------|-------|----------------------------------------------------------------------------------------|\n| `operation_type` | `str` | The operation type to search for. Available values: [\"all\", \"usdollar\", \"nonusdollar\"] |\n| `start_date` | `str` | The start date (inclusive) from which to search, depending on date type. Defaults to current date. Format YYYY-MM-DD. |\n| `end_date` | `str` | The end date (inclusive) up until which to search, depending on date type. Format YYYY-MM-DD. |\n| `date_type` | `str` | The date type to search for within the start and end. Defaults to trade date. Available values : [\"trade\", \"maturity\"] |\n| `counterparties` | `str` | A comma-separated list of counterparty names to search for. Partial names are accepted. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing Liquidity Swaps operation Results.\n\n\n### fxs.counterparties\nReturns Counterparties of Liquidity Swaps operations.\n\n```python\nfrom nyfedapi import fxs\ndf = fxs.counterparties()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing counterparties of Liquidity Swaps operations.\n\n\n## Guide Sheets\n\n### guidesheets.latest\nReturns the latest Guide Sheet. Work in Progress (WIP).\n\n```python\nfrom nyfedapi import guidesheets\ndf = guidesheets.latest()\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|------------------|-------|------------------------------------------------------------|\n| `guidesheet_type` | `str` | The guide sheet type. Available values: [\"si\", \"wi\", \"fs\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest Guide Sheet.\n\n\n### guidesheets.previous\nReturns the previous Guide Sheet. Work in Progress (WIP).\n\n```python\nfrom nyfedapi import guidesheets\ndf = guidesheets.previous()\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|------------------|-------|------------------------------------------------------------|\n| `guidesheet_type` | `str` | The guide sheet type. Available values: [\"si\", \"wi\", \"fs\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest Guide Sheet.\n\n\n## Primary Dealer Statistics\n\n### pd.latest\nReturns the latest Survey results for each timeseries.\n\n```python\nfrom nyfedapi import pd\ndf = pd.latest()\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|---------------|-------|-----------------------------|\n| `seriesbreak` | `str` | A valid series break value. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest Survey results for each timeseries.\n\n\n### pd.get_all_timeseries\nReturns all Survey results.\n\n```python\nfrom nyfedapi import pd\ndf = pd.get_all_timeseries()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing all Survey results.\n\n\n### pd.list_timeseries\nReturns Description of timeseries/keyids.\n\n```python\nfrom nyfedapi import pd\ndf = pd.list_timeseries()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing description of timeseries/keyids.\n\n\n### pd.list_asof\nReturns all As Of Dates with respective Series Break.\n\n```python\nfrom nyfedapi import pd\ndf = pd.list_asof()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing all as of dates with respective series break.\n\n\n### pd.list_seriesbreaks\nReturns Series Breaks including Label, Start and End Date.\n\n```python\nfrom nyfedapi import pd\ndf = pd.list_seriesbreaks()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing series breaks including label, start and end date.\n\n\n### pd.get_asof\nReturns single date Survey results.\n\n```python\nfrom nyfedapi import pd\ndf = pd.get_asof()\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-----------|-------|------------------------------------------------|\n| `date` | `str` | The time series as of date. Format YYYY-MM-DD. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing single date survey results.\n\n\n### pd.get_timeseries\nReturn Survey results for given timeseries across all Series Breaks. To query multiple timeseries, separate each with underscore(_).\n\n```python\nfrom nyfedapi import pd\ndf = pd.get_timeseries()\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|--------------|-------|-----------------------------------------------------|\n| `timeseries` | `str` | A list of time series ids separated by underscores. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing survey results for given timeseries across all series breaks.\n\n\n### pd.get_seriesbreaks_timeseries\nReturn Survey results for given timeseries across all Series Breaks. To query multiple timeseries, separate each with underscore(_).\n\n```python\nfrom nyfedapi import pd\ndf = pd.get_seriesbreaks_timeseries()\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|----------------|-------|-----------------------------------------------------|\n| `seriesbreaks` | `str` | A valid series break value. |\n| `timeseries` | `str` | A list of valid time series separated with underscores. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing survey results for given timeseries across all series breaks.\n\n\n## Primary Dealer Statistics Market Share\n\n### marketshare.qtrly_latest\nReturns the latest quarterly Market Share.\n\n```python\nfrom nyfedapi import marketshare\ndf = marketshare.qtrly_latest()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest quarterly market share.\n\n\n### marketshare.ytd_latest\n\nReturns the latest year-to-date Market Share.\n\n```python\nfrom nyfedapi import marketshare\ndf = marketshare.ytd_latest()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest year-to-date market share.\n\n\n## Reference Rates\n\n### rates.all_latest\nReturns the latest secured and unsecured rates.\n\n```python\nfrom nyfedapi import rates\ndf = rates.all_latest()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest secured and unsecured rates.\n\n\n### rates.all_search\nReturns the latest secured and unsecured rates.\n\n```python\nfrom nyfedapi import rates\ndf = rates.all_search()\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|--------------|-------|---------------------------------------------------------------------------------------------------|\n| `start_date` | `str` | The start date (inclusive) from which to search. Defaults to the current date. Format YYYY-MM-DD. |\n| `end_date` | `str` | The end date (inclusive) up until which to search. Format YYYY-MM-DD. |\n| `type` | `str` | The report type to return. Available values : [\"rate\", \"volume\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest secured and unsecured rates.\n\n\n### rates.secured_all_latest\nReturns the latest secured rates.\n\n```python\nfrom nyfedapi import rates\ndf = rates.secured_all_latest()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest secured rates.\n\n\n### rates.secured_last_number\nReturns the last N number of secured rates.\n\n```python\nfrom nyfedapi import rates\ndf = rates.secured_last_number(rate_type, number)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------|-------|----------------------------------------------------------------------|\n| `rate_type` | `str` | The rate type. Available values : [\"tgcr\", \"bgcr\", \"sofr\", \"sofrai\"] |\n| `number` | `int` | The last N amount of rates to return. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the last N number of secured rates.\n\n\n### rates.secured_search\nReturns secured rates and/or volume.\n\n```python\nfrom nyfedapi import rates\ndf = rates.secured_search(rate_type, **kwargs)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|--------------|-------|--------------------------------------------------------------------------------------------------|\n| `rate_type` | `str` | The rate type. Available values : [\"all\", \"tgcr\", \"bgcr\", \"sofr\", \"sofrai\"] |\n| `start_date` | `str` | The start date (inclusive) from which to search. Defaults to the current date. Format YYYY-MM-DD |\n| `end_date` | `str` | The end date (inclusive) up until which to search. Format YYYY-MM-DD |\n| `type` | `str` | The report type to return. Available values : [\"rate\", \"volume\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing secured rates and/or volume.\n\n\n### rates.unsecured_all_latest\nReturns the latest unsecured rates.\n\n```python\nfrom nyfedapi import rates\ndf = rates.unsecured_all_latest()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest unsecured rates.\n\n\n### rates.unsecured_last_number\nReturns the last N number of unsecured rates.\n\n```python\nfrom nyfedapi import rates\ndf = rates.unsecured_last_number(rate_type, number)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------|-------|-----------------------------------------------------|\n| `rate_type` | `str` | The rate type. Available values : [\"effr\", \"obfr\"] |\n| `number` | `int` | The last N amount of rates to return. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the last N number of unsecured rates.\n\n\n### rates.unsecured_search\nReturns unsecured rates and/or volume.\n\n```python\nfrom nyfedapi import rates\ndf = rates.unsecured_search(rate_type, **kwargs)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|--------------|-------|---------------------------------------------------------------------------------------------------|\n| `rate_type` | `str` | The rate type. Available values : [\"all\", \"efr\", \"obfr\"] |\n| `start_date` | `str` | The start date (inclusive) from which to search. Defaults to the current date. Format YYYY-MM-DD. |\n| `end_date` | `str` | The end date (inclusive) up until which to search. Format YYYY-MM-DD. |\n| `type` | `str` | The report type to return. Available values : [\"rate\", \"volume\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing unsecured rates and/or volume.\n\n\n## Repo and Reverse Repo Operations\n\n### rp.latest\nReturns the latest Repo and/or Reverse Repo operations Announcements or Results for the current day.\n\n```python\nfrom nyfedapi import rp\ndf = rp.latest(operation_type, method, status)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|------------------|-------|---------------------------------------------------------------------------------|\n| `operation_type` | `str` | The operation type. Available values : [\"all\", \"repo\", \"reverserepo\"] |\n| `method` | `str` | The operation method. Available values : [\"all\", \"fixed\", \"single\", \"multiple\"] |\n| `status` | `str` | The operation status. Available values : [\"announcements\", \"results\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest repo and/or reverse repo operations announcements or results for the current day.\n\n\n### rp.results_last_two_weeks\nReturns the last two weeks Repo and/or Reverse Repo operations Results.\n\n```python\nfrom nyfedapi import rp\ndf = rp.results_last_two_weeks(operation_type, method)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|------------------|-------|---------------------------------------------------------------------------------|\n| `operation_type` | `str` | The operation type. Available values : [\"all\", \"repo\", \"reverserepo\"] |\n| `method` | `str` | The operation method. Available values : [\"all\", \"fixed\", \"single\", \"multiple\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the last two weeks repo and/or reverse repo operations results.\n\n\n### rp.results_last_number\nReturns the last N number of Repo and/or Reverse Repo operations Results.\n\n```python\nfrom nyfedapi import rp\ndf = rp.results_last_number(operation_type, method, number)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|------------------|-------|--------------------------------------------------------------------------------|\n| `operation_type` | `str` | The operation type. Available values : [\"all\", \"repo\", \"reverserepo\"] |\n| `method` | `str` | The operation method. Available values : [\"all\", \"fixed\", \"single\", \"multiple\"] |\n| `number` | `int` | The last N amount of operations to return. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the last N number of repo and/or reverse repo operations results.\n\n\n### rp.results_search\nReturns Repo and/or Reverse Repo operation Results.\n\n```python\nfrom nyfedapi import rp\ndf = rp.results_search(**kwargs)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `start_date` | `str` | The start date (inclusive) from which to search. Format YYYY-MM-DD. |\n| `end_date` | `str` | The end date (inclusive) up until which to search. Format YYYY-MM-DD. |\n| `operation_types` | `str` | The operation types (comma-delimited) by which to filter. Available values : [\"Repo\", \"Reverse Repo\"] |\n| `method` | `str` | The operation method by which to filter. Available values : [\"multiple\", \"single\", \"fixed\"] |\n| `security_type` | `str` | The security type (tranche) by which to filter. For specific types, only operations which include that type will be returned. Available values : [\"mbs\", \"agency\", \"tsy\", \"srf\"] |\n| `term` | `str` | The term of the operation. Available values : [\"overnight\", \"term\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing repo and/or reverse repo operation results.\n\n\n### rp.reverserepo_propositions_search\nReturns Propositions for Reverse Repo operations.\n\n```python\nfrom nyfedapi import rp\ndf = rp.reverserepo_propositions_search(**kwargs)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `start_date` | `str` | The start date (inclusive) from which to search. Format YYYY-MM-DD. |\n| `end_date` | `str` | The end date (inclusive) up until which to search. Format YYYY-MM-DD. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing propositions for reverse repo operations.\n\n\n## Securities Lending Operations\n\n### seclending.results_latest\nReturns the latest Securities Lending operation Results for the current day.\n\n```python\nfrom nyfedapi import seclending\ndf = seclending.results_latest(operation, include)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `operation` | `str` | The operation type. Available values : [\"all\", \"seclending\", \"extensions\"]. |\n| `include` | `str` | The level of details to include. Available values : [\"summary\", \"details\"]. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest securities lending operation results for the current day.\n\n\n### seclending.results_last_two_weeks\nReturns the last two weeks Securities Lending operation Results and/or Extensions.\n\n```python\nfrom nyfedapi import seclending\ndf = seclending.results_last_two_weeks(operation, include)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `operation` | `str` | The operation type. Available values : [\"all\", \"seclending\", \"extensions\"]. |\n| `include` | `str` | The level of details to include. Available values : [\"summary\", \"details\"]. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the last two weeks securities lending operation results and/or extensions.\n\n\n### seclending.results_last_number\nReturns the last N number of Securities Lending operation Results and/or Extensions.\n\n```python\nfrom nyfedapi import seclending\ndf = seclending.results_last_number(operation, include, number)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `operation` | `str` | The operation type. Available values : [\"all\", \"seclending\", \"extensions\"]. |\n| `include` | `str` | The level of details to include. Available values : [\"summary\", \"details\"]. |\n| `number` | `int` | The last N amount of operations to return. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the last N number of securities lending operation results and/or extensions.\n\n\n### seclending.results_search\nReturns Securities Lending operation Results and/or Extensions.\n\n```python\nfrom nyfedapi import seclending\ndf = seclending.results_search(operation, include)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `operation` | `str` | The operation type. Available values : [\"all\", \"seclending\", \"extensions\"]. |\n| `include` | `str` | The level of details to include. Available values : [\"summary\", \"details\"]. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing securities lending operation results and/or extensions.\n\n\n## System Open Market Account Holdings\n\n### soma.asofdates_latest\nReturns the latest SOMA holdings As Of Date.\n\n```python\nfrom nyfedapi import soma\ndf = soma.asofdates_latest()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest SOMA holdings As Of Date.\n\n\n### soma.summary\nReturns Summary Of SOMA holdings for each As of Date and holding type.\n\n```python\nfrom nyfedapi import soma\nndf = soma.summary()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing summary of SOMA holdings for each as of date and holding type.\n\n\n### soma.asofdates_list\nReturns all SOMA holdings As of Date.\n\n```python\nfrom nyfedapi import soma\ndf = soma.asofdates_list()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing all SOMA holdings as of date.\n\n\n### soma.agency_get_release_log\nReturns the last three months Agency Release and As Of Dates.\n\n```python\nfrom nyfedapi import soma\ndf = soma.agency_get_release_log()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the last three months Agency release and as of dates.\n\n\n### soma.agency_get_asof\nReturns a single date SOMA Agency Holdings.\n\n```python\nfrom nyfedapi import soma\ndf = soma.agency_get_asof(date)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-----------|-------|-----------------------------------------------------------------------------|\n| `date` | `str` | The date for which to retrieve the agency release. Format YYYY-MM-DD. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing a single date SOMA Agency holdings.\n\n\n### soma.agency_get_cusip\nReturns all SOMA Agency Holdings for a single CUSIP.\n\n```python\nfrom nyfedapi import soma\ndf = soma.agency_get_cusip(cusip)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|----------|-------|-----------------------------------------------------------------------------|\n| `cusip` | `str` | The CUSIP for which to retrieve information. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing all SOMA Agency Holdings for a single CUSIP.\n\n\n### soma.agency_get_holdingtype_asof\nReturns a single date SOMA Agency Holdings for a Agency holding type.\n\n```python\nfrom nyfedapi import soma\ndf = soma.agency_get_holdingtype_asof(holding_type, date)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|----------------|-------|-------------------------------------------------------------------------------------------------|\n| `holding_type` | `str` | The holding type for which to retrieve. Available values: [\"all\", \"agency debts\", \"mbs\", \"cmb\"] |\n| `date` | `str` | The date for which to retrieve the agency release. Format YYYY-MM-DD. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing a single date SOMA Agency holdings for a Agency holding type.\n\n\n### soma.agency_wam_asof\nReturns a single date Weighted Average Maturity for Agency Debt.\n\n```python\nfrom nyfedapi import soma\ndf = soma.agency_wam_asof(date)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|----------------|-------|-------------------------------------------------------------------------------------------------|\n| `date` | `str` | The date for which to retrieve the Weighted Average Maturity number. Format YYYY-MM-DD. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing a single date Weighted Average Maturity for Agency Debt.\n\n\n### soma.tsy_get_release_log\nReturns the last three months Treasury Release and As Of Dates.\n\n```python\nfrom nyfedapi import soma\ndf = soma.tsy_get_release_log()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the last three months Treasury release and as of dates.\n\n\n### soma.tsy_get_asof\nReturns a single date SOMA Treasury Holdings.\n\n```python\nfrom nyfedapi import soma\ndf = soma.tsy_get_asof(date)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-----------|-------|-------------------------------------------------------------------------|\n| `date` | `str` | The date for which to retrieve the treasury release. Format YYYY-MM-DD. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing a single date SOMA Treasury holdings.\n\n\n### soma.tsy_get_cusip\nReturns all SOMA Treasury Holdings for a single CUSIP.\n\n```python\nfrom nyfedapi import soma\ndf = soma.tsy_get_cusip(cusip)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|----------|-------|-----------------------------------------------------------------------------|\n| `cusip` | `str` | The CUSIP for which to retrieve information. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing all SOMA Treasury Holdings for a single CUSIP.\n\n\n### soma.tsy_get_holdingtype_asof\nReturns a single date SOMA Treasury Holdings for a Treasury holding type.\n\n```python\nfrom nyfedapi import soma\ndf = soma.tsy_get_holdingtype_asof(holding_type, date)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|----------------|-------|---------------------------------------------------------------------------------------------------------|\n| `holding_type` | `str` | The holding type for which to retrieve. Available values: [\"all\", \"bills\", \"notesbonds\", \"frn\", \"tips\"] |\n| `date` | `str` | The date for which to retrieve the treasury release. Format YYYY-MM-DD. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing a single date SOMA Treasury Holdings for a Treasury holding type.\n\n\n### soma.tsy_wam_holdingtype_asof\nReturns a single date Weighted Average Maturity for a Treasury holding type.\n\n```python\nfrom nyfedapi import soma\nndf = soma.tsy_wam_holdingtype_asof(holding_type, date)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|----------------|-------|---------------------------------------------------------------------------------------------------------|\n| `holding_type` | `str` | The holding type for which to retrieve. Available values: [\"all\", \"bills\", \"notesbonds\", \"frn\", \"tips\"] |\n| `date` | `str` | The date for which to retrieve the Weighted Average Maturity number. Format YYYY-MM-DD. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing a single date Weighted Average Maturity for a Treasury holding type.\n\n\n### soma.tsy_get_monthly\nReturns all SOMA Treasury Holdings at monthly intervals.\n\n```python\nfrom nyfedapi import soma\ndf = soma.tsy_get_monthly()\n```\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing all SOMA Treasury Holdings at monthly intervals.\n\n\n## Treasury Securities Operations\n\n### tsy.latest\nReturns the latest Treasury operation Announcements or Results for the current day.\n\n```python\nfrom nyfedapi import tsy\ndf = tsy.latest(operation, status, include)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------|-------|-------------------------------------------------------------------------------------|\n| `operation` | `str` | The operation type. Available values: [\"all\", \"purchases\", \"sales\"] |\n| `status` | `str` | The operation status. Available values: [\"announcements\", \"results\", \"operations\"\"] |\n| `include` | `str` | The level of details to include. Available values: [\"summary\", \"details\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the latest Treasury operation announcements or results for the current day.\n\n\n### tsy.results_last_two_weeks\nReturns the last two weeks Treasury operations Results.\n\n```python\nfrom nyfedapi import tsy\ndf = tsy.results_last_two_weeks(operation, include)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------|-------|-------------------------------------------------------------------------------------|\n| `operation` | `str` | The operation type. Available values: [\"all\", \"purchases\", \"sales\"] |\n| `include` | `str` | The level of details to include. Available values: [\"summary\", \"details\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the last two weeks Treasury operations results.\n\n\n### tsy.results_last_number\nReturns the last N number of Treasury operations Results.\n\n```python\nfrom nyfedapi import tsy\ndf = tsy.results_last_number(operation, include, number)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------|-------|---------------------------------------------------------------------------|\n| `operation` | `str` | The operation type. Available values: [\"all\", \"purchases\", \"sales\"] |\n| `include` | `str` | The level of details to include. Available values: [\"summary\", \"details\"] |\n| `number` | `int` | The last amount of results to return from current date. |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing the last N number of Treasury operations Results.\n\n\n### tsy.results_search\nReturns Treasury operation Results.\n\n```python\nfrom nyfedapi import tsy\ndf = tsy.results_search(operation, include)\n```\n\n#### Parameters\n| Parameter | Type | Description |\n|-------------|-------|---------------------------------------------------------------------------|\n| `operation` | `str` | The operation type. Available values: [\"all\", \"purchases\", \"sales\"] |\n| `include` | `str` | The level of details to include. Available values: [\"summary\", \"details\"] |\n\n#### Returns\n- `pd.DataFrame`: A DataFrame containing Treasury operation results.\n\n\n## TODO\n- [ ] Add a keyword argument (kwargs) translator. Example: startDate -> start_date\n- [ ] Implement the marketshare and guidesheets endpoints, as they currently do not support CSV format download.\n- [ ] Issue with ```seclending.results_search()```: Although startDate and endDate are not required, omitting them results in a 404 error with the response: [\"Cannot exceed allowed span of 1 year\"].\n- [ ] Issue with ```ambs.results_search()```: Although startDate and endDate are not required, omitting them results in a 404 error with the response: [\"Cannot exceed allowed span of 2 years\"].\n\n## API Documentation\n- [Markets Data APIs: Federal Reserve Bank of New York (FRBoNY)](https://markets.newyorkfed.org/static/docs/markets-api.html)\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A Python wrapper to easily retrieve data from the Federal Reserve Bank of New York (FRBoNY) official API in pandas format.",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/Jaldekoa/nyfedapi"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4650b21f0c472a02c372a79f76a675f44e21d3418dac4cb653d4deededcd4422",
"md5": "b8325a61c65d647ba9ff463896103bfe",
"sha256": "e561d3de3e0f12de8dc6aba53f42d56fc3bcac8d3b66587484bf8c4d093f29f9"
},
"downloads": -1,
"filename": "nyfedapi-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b8325a61c65d647ba9ff463896103bfe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 14766,
"upload_time": "2024-09-19T19:57:26",
"upload_time_iso_8601": "2024-09-19T19:57:26.340856Z",
"url": "https://files.pythonhosted.org/packages/46/50/b21f0c472a02c372a79f76a675f44e21d3418dac4cb653d4deededcd4422/nyfedapi-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "64da2e5904a927e7c4d4d6403a867268319f2d8f89a52f5eb495df85567f7315",
"md5": "71bd67f48fa7d6cc66e298fbb6441ad7",
"sha256": "180356ca1e58489ea55be1032e7fbaa4f2b508c3519867fcd45fcf609b927c18"
},
"downloads": -1,
"filename": "nyfedapi-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "71bd67f48fa7d6cc66e298fbb6441ad7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19012,
"upload_time": "2024-09-19T19:57:27",
"upload_time_iso_8601": "2024-09-19T19:57:27.535232Z",
"url": "https://files.pythonhosted.org/packages/64/da/2e5904a927e7c4d4d6403a867268319f2d8f89a52f5eb495df85567f7315/nyfedapi-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-19 19:57:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Jaldekoa",
"github_project": "nyfedapi",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "pandas",
"specs": [
[
">=",
"2.0.0"
]
]
},
{
"name": "requests",
"specs": [
[
">=",
"2.23.0"
]
]
},
{
"name": "setuptools",
"specs": [
[
">=",
"68.2"
]
]
},
{
"name": "pytest",
"specs": [
[
">=",
"7.4.4"
]
]
}
],
"lcname": "nyfedapi"
}