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
country: 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.
Choices
- all
- advanced_economies
- afghanistan
- africa
- africa_not_allocated
- albania
- algeria
- american_samoa
- angola
- anguilla
- antigua_and_barbuda
- antilles
- argentina
- armenia
- aruba
- asia_not_allocated
- australia
- austria
- azerbaijan
- bahamas
- bahrain
- bangladesh
- barbados
- belarus
- belgium
- belgo-luxembourg_economic_union
- belize
- benin
- bermuda
- bhutan
- bolivia
- bosnia_and_herzegovina
- botswana
- brazil
- brunei_darussalam
- bulgaria
- burkina_faso
- burundi
- cabo_verde
- cambodia
- cameroon
- canada
- central_african_republic
- chad
- chile
- china
- colombia
- community_of_independent_states
- comoros
- congo
- costa_rica
- croatia
- cuba
- curacao
- cyprus
- czech_republic
- democratic_republic_of_the_congo
- denmark
- developing_asia
- djibouti
- dominica
- dominican_republic
- east_germany
- eastern_caribbean_currency_union
- ecuador
- egypt
- el_salvador
- emerging_and_developing_countries
- emerging_and_developing_europe
- equatorial_guinea
- eritrea
- estonia
- eswatini
- ethiopia
- euro_area
- europe
- europe_not_allocated
- european_union
- export_earnings_fuel
- export_earnings_nonfuel
- falkland_islands
- faroe_islands
- fiji
- finland
- former_czechoslovakia
- former_ussr
- former_yugoslavia
- france
- french_polynesia
- gabon
- gambia
- georgia
- germany
- ghana
- gibraltar
- greece
- greenland
- grenada
- guam
- guatemala
- guinea
- guyana
- haiti
- honduras
- hong_kong
- hungary
- iceland
- india
- indonesia
- iran
- iraq
- ireland
- israel
- italy
- ivory_coast
- jamaica
- japan
- jordan
- kazakhstan
- kenya
- kiribati
- kosovo
- kuwait
- kyrgyzstan
- lao
- latvia
- lebanon
- lesotho
- liberia
- libya
- lithuania
- luxembourg
- macao
- madagascar
- malawi
- malaysia
- maldives
- mali
- malta
- marshall_islands
- mauritania
- mauritius
- mexico
- micronesia
- middle_east
- middle_east_and_central_asia
- middle_east_and_central_asia_not_specified
- middle_east_north_africa_afghanistan_and_pakistan
- moldova
- mongolia
- montenegro
- montserrat
- morocco
- mozambique
- myanmar
- namibia
- nauru
- nepal
- netherlands
- new_caledonia
- new_zealand
- nicaragua
- niger
- nigeria
- north_korea
- north_macedonia
- north_vietnam
- norway
- oman
- other_countries_nie
- pakistan
- palau
- palestine
- panama
- papua_new_guinea
- paraguay
- peru
- philippines
- poland
- portugal
- qatar
- romania
- russia
- rwanda
- saint_kitts_and_nevis
- saint_lucia
- saint_vincent_and_the_grenadines
- samoa
- san_marino
- sao_tome_and_principe
- saudi_arabia
- senegal
- serbia
- serbia_and_montenegro
- seychelles
- sierra_leone
- singapore
- sint_maarten
- slovakia
- slovenia
- solomon_islands
- somalia
- south_africa
- south_african_common_customs_area
- south_korea
- south_sudan
- spain
- special_categories_and_economic_zones
- sri_lanka
- sub-saharan_africa
- sudan
- suriname
- sweden
- switzerland
- syria
- taiwan
- tajikistan
- tanzania
- thailand
- timor-leste
- togo
- tonga
- trinidad_and_tobago
- tunisia
- turkey
- turkmenistan
- tuvalu
- uganda
- ukraine
- united_arab_emirates
- united_kingdom
- united_states
- uruguay
- uzbekistan
- vanuatu
- vatican_city_state
- venezuela
- viet_nam
- west_malaysia
- western_hemisphere
- western_hemisphere_not_allocated
- world
- yemen
- yemen_arab_rep
- yemen_pd_rep
- zambia
- zimbabwe
counterpart: 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.
Choices
- all
- advanced_economies
- afghanistan
- africa
- africa_not_allocated
- albania
- algeria
- american_samoa
- angola
- anguilla
- antigua_and_barbuda
- antilles
- argentina
- armenia
- aruba
- asia_not_allocated
- australia
- austria
- azerbaijan
- bahamas
- bahrain
- bangladesh
- barbados
- belarus
- belgium
- belgo-luxembourg_economic_union
- belize
- benin
- bermuda
- bhutan
- bolivia
- bosnia_and_herzegovina
- botswana
- brazil
- brunei_darussalam
- bulgaria
- burkina_faso
- burundi
- cabo_verde
- cambodia
- cameroon
- canada
- central_african_republic
- chad
- chile
- china
- colombia
- community_of_independent_states
- comoros
- congo
- costa_rica
- croatia
- cuba
- curacao
- cyprus
- czech_republic
- democratic_republic_of_the_congo
- denmark
- developing_asia
- djibouti
- dominica
- dominican_republic
- east_germany
- eastern_caribbean_currency_union
- ecuador
- egypt
- el_salvador
- emerging_and_developing_countries
- emerging_and_developing_europe
- equatorial_guinea
- eritrea
- estonia
- eswatini
- ethiopia
- euro_area
- europe
- europe_not_allocated
- european_union
- export_earnings_fuel
- export_earnings_nonfuel
- falkland_islands
- faroe_islands
- fiji
- finland
- former_czechoslovakia
- former_ussr
- former_yugoslavia
- france
- french_polynesia
- gabon
- gambia
- georgia
- germany
- ghana
- gibraltar
- greece
- greenland
- grenada
- guam
- guatemala
- guinea
- guyana
- haiti
- honduras
- hong_kong
- hungary
- iceland
- india
- indonesia
- iran
- iraq
- ireland
- israel
- italy
- ivory_coast
- jamaica
- japan
- jordan
- kazakhstan
- kenya
- kiribati
- kosovo
- kuwait
- kyrgyzstan
- lao
- latvia
- lebanon
- lesotho
- liberia
- libya
- lithuania
- luxembourg
- macao
- madagascar
- malawi
- malaysia
- maldives
- mali
- malta
- marshall_islands
- mauritania
- mauritius
- mexico
- micronesia
- middle_east
- middle_east_and_central_asia
- middle_east_and_central_asia_not_specified
- middle_east_north_africa_afghanistan_and_pakistan
- moldova
- mongolia
- montenegro
- montserrat
- morocco
- mozambique
- myanmar
- namibia
- nauru
- nepal
- netherlands
- new_caledonia
- new_zealand
- nicaragua
- niger
- nigeria
- north_korea
- north_macedonia
- north_vietnam
- norway
- oman
- other_countries_nie
- pakistan
- palau
- palestine
- panama
- papua_new_guinea
- paraguay
- peru
- philippines
- poland
- portugal
- qatar
- romania
- russia
- rwanda
- saint_kitts_and_nevis
- saint_lucia
- saint_vincent_and_the_grenadines
- samoa
- san_marino
- sao_tome_and_principe
- saudi_arabia
- senegal
- serbia
- serbia_and_montenegro
- seychelles
- sierra_leone
- singapore
- sint_maarten
- slovakia
- slovenia
- solomon_islands
- somalia
- south_africa
- south_african_common_customs_area
- south_korea
- south_sudan
- spain
- special_categories_and_economic_zones
- sri_lanka
- sub-saharan_africa
- sudan
- suriname
- sweden
- switzerland
- syria
- taiwan
- tajikistan
- tanzania
- thailand
- timor-leste
- togo
- tonga
- trinidad_and_tobago
- tunisia
- turkey
- turkmenistan
- tuvalu
- uganda
- ukraine
- united_arab_emirates
- united_kingdom
- united_states
- uruguay
- uzbekistan
- vanuatu
- vatican_city_state
- venezuela
- viet_nam
- west_malaysia
- western_hemisphere
- western_hemisphere_not_allocated
- world
- yemen
- yemen_arab_rep
- yemen_pd_rep
- zambia
- zimbabwe
direction: Literal['exports', 'imports', 'balance', 'all']
Default: balance
Trade direction. Use 'all' to get all data for this dimension.
start_date: date | str
Start date of the data, in YYYY-MM-DD format.
end_date: date | str
End date of the data, in YYYY-MM-DD format.
frequency: Literal['month', 'quarter', 'annual']
Default: month
The frequency of the data.
country: 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.
Choices
- all
- advanced_economies
- afghanistan
- africa
- africa_not_allocated
- albania
- algeria
- american_samoa
- angola
- anguilla
- antigua_and_barbuda
- antilles
- argentina
- armenia
- aruba
- asia_not_allocated
- australia
- austria
- azerbaijan
- bahamas
- bahrain
- bangladesh
- barbados
- belarus
- belgium
- belgo-luxembourg_economic_union
- belize
- benin
- bermuda
- bhutan
- bolivia
- bosnia_and_herzegovina
- botswana
- brazil
- brunei_darussalam
- bulgaria
- burkina_faso
- burundi
- cabo_verde
- cambodia
- cameroon
- canada
- central_african_republic
- chad
- chile
- china
- colombia
- community_of_independent_states
- comoros
- congo
- costa_rica
- croatia
- cuba
- curacao
- cyprus
- czech_republic
- democratic_republic_of_the_congo
- denmark
- developing_asia
- djibouti
- dominica
- dominican_republic
- east_germany
- eastern_caribbean_currency_union
- ecuador
- egypt
- el_salvador
- emerging_and_developing_countries
- emerging_and_developing_europe
- equatorial_guinea
- eritrea
- estonia
- eswatini
- ethiopia
- euro_area
- europe
- europe_not_allocated
- european_union
- export_earnings_fuel
- export_earnings_nonfuel
- falkland_islands
- faroe_islands
- fiji
- finland
- former_czechoslovakia
- former_ussr
- former_yugoslavia
- france
- french_polynesia
- gabon
- gambia
- georgia
- germany
- ghana
- gibraltar
- greece
- greenland
- grenada
- guam
- guatemala
- guinea
- guyana
- haiti
- honduras
- hong_kong
- hungary
- iceland
- india
- indonesia
- iran
- iraq
- ireland
- israel
- italy
- ivory_coast
- jamaica
- japan
- jordan
- kazakhstan
- kenya
- kiribati
- kosovo
- kuwait
- kyrgyzstan
- lao
- latvia
- lebanon
- lesotho
- liberia
- libya
- lithuania
- luxembourg
- macao
- madagascar
- malawi
- malaysia
- maldives
- mali
- malta
- marshall_islands
- mauritania
- mauritius
- mexico
- micronesia
- middle_east
- middle_east_and_central_asia
- middle_east_and_central_asia_not_specified
- middle_east_north_africa_afghanistan_and_pakistan
- moldova
- mongolia
- montenegro
- montserrat
- morocco
- mozambique
- myanmar
- namibia
- nauru
- nepal
- netherlands
- new_caledonia
- new_zealand
- nicaragua
- niger
- nigeria
- north_korea
- north_macedonia
- north_vietnam
- norway
- oman
- other_countries_nie
- pakistan
- palau
- palestine
- panama
- papua_new_guinea
- paraguay
- peru
- philippines
- poland
- portugal
- qatar
- romania
- russia
- rwanda
- saint_kitts_and_nevis
- saint_lucia
- saint_vincent_and_the_grenadines
- samoa
- san_marino
- sao_tome_and_principe
- saudi_arabia
- senegal
- serbia
- serbia_and_montenegro
- seychelles
- sierra_leone
- singapore
- sint_maarten
- slovakia
- slovenia
- solomon_islands
- somalia
- south_africa
- south_african_common_customs_area
- south_korea
- south_sudan
- spain
- special_categories_and_economic_zones
- sri_lanka
- sub-saharan_africa
- sudan
- suriname
- sweden
- switzerland
- syria
- taiwan
- tajikistan
- tanzania
- thailand
- timor-leste
- togo
- tonga
- trinidad_and_tobago
- tunisia
- turkey
- turkmenistan
- tuvalu
- uganda
- ukraine
- united_arab_emirates
- united_kingdom
- united_states
- uruguay
- uzbekistan
- vanuatu
- vatican_city_state
- venezuela
- viet_nam
- west_malaysia
- western_hemisphere
- western_hemisphere_not_allocated
- world
- yemen
- yemen_arab_rep
- yemen_pd_rep
- zambia
- zimbabwe
counterpart: 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.
Choices
- all
- advanced_economies
- afghanistan
- africa
- africa_not_allocated
- albania
- algeria
- american_samoa
- angola
- anguilla
- antigua_and_barbuda
- antilles
- argentina
- armenia
- aruba
- asia_not_allocated
- australia
- austria
- azerbaijan
- bahamas
- bahrain
- bangladesh
- barbados
- belarus
- belgium
- belgo-luxembourg_economic_union
- belize
- benin
- bermuda
- bhutan
- bolivia
- bosnia_and_herzegovina
- botswana
- brazil
- brunei_darussalam
- bulgaria
- burkina_faso
- burundi
- cabo_verde
- cambodia
- cameroon
- canada
- central_african_republic
- chad
- chile
- china
- colombia
- community_of_independent_states
- comoros
- congo
- costa_rica
- croatia
- cuba
- curacao
- cyprus
- czech_republic
- democratic_republic_of_the_congo
- denmark
- developing_asia
- djibouti
- dominica
- dominican_republic
- east_germany
- eastern_caribbean_currency_union
- ecuador
- egypt
- el_salvador
- emerging_and_developing_countries
- emerging_and_developing_europe
- equatorial_guinea
- eritrea
- estonia
- eswatini
- ethiopia
- euro_area
- europe
- europe_not_allocated
- european_union
- export_earnings_fuel
- export_earnings_nonfuel
- falkland_islands
- faroe_islands
- fiji
- finland
- former_czechoslovakia
- former_ussr
- former_yugoslavia
- france
- french_polynesia
- gabon
- gambia
- georgia
- germany
- ghana
- gibraltar
- greece
- greenland
- grenada
- guam
- guatemala
- guinea
- guyana
- haiti
- honduras
- hong_kong
- hungary
- iceland
- india
- indonesia
- iran
- iraq
- ireland
- israel
- italy
- ivory_coast
- jamaica
- japan
- jordan
- kazakhstan
- kenya
- kiribati
- kosovo
- kuwait
- kyrgyzstan
- lao
- latvia
- lebanon
- lesotho
- liberia
- libya
- lithuania
- luxembourg
- macao
- madagascar
- malawi
- malaysia
- maldives
- mali
- malta
- marshall_islands
- mauritania
- mauritius
- mexico
- micronesia
- middle_east
- middle_east_and_central_asia
- middle_east_and_central_asia_not_specified
- middle_east_north_africa_afghanistan_and_pakistan
- moldova
- mongolia
- montenegro
- montserrat
- morocco
- mozambique
- myanmar
- namibia
- nauru
- nepal
- netherlands
- new_caledonia
- new_zealand
- nicaragua
- niger
- nigeria
- north_korea
- north_macedonia
- north_vietnam
- norway
- oman
- other_countries_nie
- pakistan
- palau
- palestine
- panama
- papua_new_guinea
- paraguay
- peru
- philippines
- poland
- portugal
- qatar
- romania
- russia
- rwanda
- saint_kitts_and_nevis
- saint_lucia
- saint_vincent_and_the_grenadines
- samoa
- san_marino
- sao_tome_and_principe
- saudi_arabia
- senegal
- serbia
- serbia_and_montenegro
- seychelles
- sierra_leone
- singapore
- sint_maarten
- slovakia
- slovenia
- solomon_islands
- somalia
- south_africa
- south_african_common_customs_area
- south_korea
- south_sudan
- spain
- special_categories_and_economic_zones
- sri_lanka
- sub-saharan_africa
- sudan
- suriname
- sweden
- switzerland
- syria
- taiwan
- tajikistan
- tanzania
- thailand
- timor-leste
- togo
- tonga
- trinidad_and_tobago
- tunisia
- turkey
- turkmenistan
- tuvalu
- uganda
- ukraine
- united_arab_emirates
- united_kingdom
- united_states
- uruguay
- uzbekistan
- vanuatu
- vatican_city_state
- venezuela
- viet_nam
- west_malaysia
- western_hemisphere
- western_hemisphere_not_allocated
- world
- yemen
- yemen_arab_rep
- yemen_pd_rep
- zambia
- zimbabwe
direction: Literal['exports', 'imports', 'balance', 'all']
Default: balance
Trade direction. Use 'all' to get all data for this dimension.
start_date: date | str
Start date of the data, in YYYY-MM-DD format.
end_date: date | str
End date of the data, in YYYY-MM-DD format.
frequency: Literal['month', 'quarter', 'annual']
Default: month
The frequency of the data.
Returns
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
date: 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.
date: 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.