Skip to main content

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

NameTypeDescriptionDefaultOptional
countryUnion[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.NoneTrue
counterpartUnion[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.NoneTrue
directionLiteral['exports', 'imports', 'balance', 'all']Trade direction. Use 'all' to get all data for this dimension.balanceTrue
start_dateUnion[date, str]Start date of the data, in YYYY-MM-DD format.NoneTrue
end_dateUnion[date, str]End date of the data, in YYYY-MM-DD format.NoneTrue
frequencyLiteral['month', 'quarter', 'annual']The frequency of the data.monthTrue

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

NameTypeDescription
dateUnion[date, str]The date of the data.
symbolstrSymbol representing the entity requested in the data.
countrystr
counterpartstrCounterpart country or region to the trade.
titlestrTitle corresponding to the symbol.
valuefloatTrade value.
scalestrScale of the value.