direction_of_trade
Get Direction Of Trade Statistics from the IMF database.
The Direction of Trade Statistics (DOTS) presents the value of merchandise exports and imports disaggregated according to a country's primary trading partners. Area and world aggregates are included in the display of trade flows between major areas of the world. Reported data is supplemented by estimates whenever such data is not available or current. Imports are reported on a cost, insurance and freight (CIF) basis and exports are reported on a free on board (FOB) basis. Time series data includes estimates derived from reports of partner countries for non-reporting and slow-reporting countries.
Examples
from openbb import obb
obb.economy.direction_of_trade(provider='imf', country='all', counterpart='china')
# Select multiple countries or counterparts by entering a comma-separated list. The direction of trade can be 'exports', 'imports', 'balance', or 'all'.
obb.economy.direction_of_trade(provider='imf', country='us', counterpart='world,eu', frequency='annual', direction='exports')
Parameters
- standard
- imf
Name | Type | Description | Default | Optional |
---|---|---|---|---|
country | Union[str, List[str]] | The country to get data. None is an equiavlent to 'all'. If 'all' is used, the counterpart field cannot be 'all'. Multiple items allowed for provider(s): imf. | None | True |
counterpart | Union[str, List[str]] | Counterpart country to the trade. None is an equiavlent to 'all'. If 'all' is used, the country field cannot be 'all'. Multiple items allowed for provider(s): imf. | None | True |
direction | Literal['exports', 'imports', 'balance', 'all'] | Trade direction. Use 'all' to get all data for this dimension. | balance | True |
start_date | Union[date, str] | Start date of the data, in YYYY-MM-DD format. | None | True |
end_date | Union[date, str] | End date of the data, in YYYY-MM-DD format. | None | True |
frequency | Literal['month', 'quarter', 'annual'] | The frequency of the data. | month | True |
Name | Type | Description | Default | Optional |
---|---|---|---|---|
country | Union[str, List[str]] | The country to get data. None is an equiavlent to 'all'. If 'all' is used, the counterpart field cannot be 'all'. Multiple items allowed for provider(s): imf. | None | True |
counterpart | Union[str, List[str]] | Counterpart country to the trade. None is an equiavlent to 'all'. If 'all' is used, the country field cannot be 'all'. Multiple items allowed for provider(s): imf. | None | True |
direction | Literal['exports', 'imports', 'balance', 'all'] | Trade direction. Use 'all' to get all data for this dimension. | balance | True |
start_date | Union[date, str] | Start date of the data, in YYYY-MM-DD format. | None | True |
end_date | Union[date, str] | End date of the data, in YYYY-MM-DD format. | None | True |
frequency | Literal['month', 'quarter', 'annual'] | The frequency of the data. | month | True |
Returns
OBBject
results : List[DirectionOfTrade]
Serializable results.
provider : Optional[Literal['imf']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra : Dict[str, Any]
Extra info.
Data
- standard
- imf
Name | Type | Description |
---|---|---|
date | Union[date, str] | The date of the data. |
symbol | str | Symbol representing the entity requested in the data. |
country | str | |
counterpart | str | Counterpart country or region to the trade. |
title | str | Title corresponding to the symbol. |
value | float | Trade value. |
scale | str | Scale of the value. |
Name | Type | Description |
---|---|---|
date | Union[date, str] | The date of the data. |
symbol | str | Symbol representing the entity requested in the data. |
country | str | |
counterpart | str | Counterpart country or region to the trade. |
title | str | Title corresponding to the symbol. |
value | float | Trade value. |
scale | str | Scale of the value. |