API

How to Embed Apps

The Basic Call Structure

Below is the basic template used to embed an app on any site.

<iframe src="/embed/APP/TRADE_FLOW/COUNTRY1/COUNTRY2/PRODUCT/YEAR/"></iframe>

Which you will notice has the following parameters: COUNTRY / COUNTRY / PRODUCT / YEAR, a byproduct of the bilateral nature of the dataset from which the apps are being built.

URI Options

App
App ID Description
tree_map Build a tree map of trade data for a particular year.
stacked Build a stacked area chart of trade data over an interval of years.
product_space Show a country's exports in the product space for a given year.
Trade Flow Description
export Change direction of trade flow to show export values.
import Change direction of trade flow to show import values.
Country Description
show Keyword used to show all bilateral countries.
all Keyword to use all bilateral countries in the query.
3_character_id Search:

View as list below →

Product Description
show Keyword to show all products in the result.
all Keyword to use all products in the query.
4_digit_id Search:

View as list below →

Year Description
year Any year between 1962 and 2009

Query parameter options

App Name Options default
All mouseover true, false true
All lang (Language) Deutsch: de, English: en, Español: es, français: fr, italiano: it, Nederlands: nl, português: pt, Pyccĸий: ru, Tϋrkçe: tr, Ελληνικά: el, 日本語: ja, 简体中文: zh_cn, 한국어: ko, हिंदी: hi, العربية: ar, עברית: he en
Stacked layout value, share value
Stacked sort value, category category

Questions

What does a country trade?

Trade Flow Country 1 Country 2 Product Year Output
export OR import Any 3 char code all show Any year from 1962 - 2009 Products

Example: What did the US export in 2008?

<iframe src="/embed/tree_map/export/usa/all/show/2008/" frameborder="0" width="600" height="480" ></iframe>

With what other countries does a country trade?

Trade Flow Country 1 Country 2 Product Year Output
export OR import Any 3 char code show all Any year from 1962 - 2009 Countries

Example: Which countries did the US export to in 2008?

<iframe src="/embed/tree_map/export/usa/show/all/2008/" frameborder="0" width="600" height="480" ></iframe>

What does a country trade with another country?

Trade Flow Country 1 Country 2 Product Year Output
export OR import Any 3 char code Any 3 char code show Any year from 1962 - 2009 Products

Example: What did the US export to China in 2008?

<iframe src="/embed/tree_map/export/usa/chn/show/2008/" frameborder="0" width="600" height="480" ></iframe>

With what other countries does a country trade a product?

Trade Flow Country 1 Country 2 Product Year Output
export OR import Any 3 char code show Any 4 digit SITC code Any year from 1962 - 2009 Countries

Example: Which countries did the US export cars to in 2008?

<iframe src="/embed/tree_map/export/usa/show/7810/2008/" frameborder="0" width="600" height="480" ></iframe>

Which countries trade a product?

Trade Flow Country 1 Country 2 Product Year Output
export OR import show all Any 4 digit SITC code Any year from 1962 - 2009 Countries

Example: Which countries exported cars in 2008?

<iframe src="/embed/tree_map/export/show/all/7810/2008/" frameborder="0" width="600" height="480" ></iframe>