Trade by product and country
Every product Pakistan exported or imported, with every partner country, for each fiscal year from 1990-91 to 2024-25. The source is the Pakistan Bureau of Statistics' customs record: one line per product code, partner and year, with quantity and value.
| Coverage | More than 15,000 product codes × 278 partners, FY1990-91 to FY2024-25 |
| Frequency | Yearly (fiscal year, July to June; fy = the year it ends, so 2025 = FY2024-25) |
| Values | Rs thousand as published, and US$ thousand at the fiscal year's average SBP exchange rate |
| Flows | export, import; to FY2020-21 also re-export, re-import |
| Endpoints | /v1/trade/* |
| On the site | The trade explorer, a page per product and per partner |
Product codes
- From FY2002-03: 8-digit Pakistan Customs Tariff codes, built on the Harmonized System. The first four digits are the HS heading (
1006rice), the first six the HS subheading, the last two Pakistan's own split (10063010basmati rice). - Before that: 7-digit codes built on SITC, a different classification. A product's history usually continues under a new code in 2002-03, so a 2001-02 code and a 2002-03 code are not comparable one to one.
- Names. PBS prints a 30-character abbreviation per code ("LEATH BUFFAL HIDES,TANN,FINISH"). Each code also has a readable
name: the official HS or SITC text where the code is itself the official item, otherwise PBS's wording with the abbreviations spelled out. The official parent heading is inhs_headingand PBS's text stays indescription. - Codes change. HS revisions (2007, 2012, 2017, 2022) split, merge and renumber codes, so a code can start or stop mid-series. HS headings move far less, which makes them the better unit for long histories.
Product pages
Every HS heading has a page that adds up its 8-digit codes, for example rice, and so does every product code, for example basmati rice. Each page has yearly exports and imports, the partner countries for any year, quantities and unit values for a single code, and the other codes in the heading. The same data comes in one call from /v1/trade/product/{code}.
Pages are listed in search engines and the sitemap when there is enough trade to say something:
- a heading with at least US$1 million of trade a year, on average over the last three fiscal years;
- a product code with at least US$10 million a year that has a clean name and is under 90% of its heading (otherwise its page repeats the heading's figures);
- a partner with at least US$10 million of trade over all the years.
Every other heading, code and partner still has its page; those pages ask search engines not to index them. The list of indexed pages is public: /v1/trade/pages.
Partners
Country names are standardised across the 35 years ("U S A" and "U.S.America" are both United States). Places that genuinely changed keep their own names: Czechoslovakia, Yugoslavia, Serbia and Montenegro, and the individual UAE emirates, which PBS listed separately until 2013. A few early lines are regional ("Asia (not specified)"). Each partner has a page, for example China, with its rank among Pakistan's export markets and suppliers and its top products each year.
Things to know
- Totals. Each code has a total line,
country=All countries; the grand total across products is codeTOTAL. A heading's total is the sum of its codes' total lines. - Quantities are in each code's own unit (
KG,MT,NO,DOZ,SQM, …), so they add up only within a code; heading pages show values only. - US dollars are converted by PakDataHub at the fiscal year's average of SBP's monthly average PKR/USD rate. PBS publishes rupees.
- Customs records, not the balance of payments. These are goods crossing the border as recorded by customs. SBP's balance-of-payments exports and imports (in the external module) count differently and do not match line by line.
Examples
# Rice (HS 1006): yearly exports and imports, its buyers and suppliers, its codes
curl -H "X-API-Key: pk_live_xxx" "https://api.pakdatahub.com/v1/trade/product/1006"
# Pakistan and China: yearly totals, China's rank, top products both ways in FY2023-24
curl -H "X-API-Key: pk_live_xxx" "https://api.pakdatahub.com/v1/trade/partner/china?fy=2024"
# Basmati exports to every country, every year
curl -H "X-API-Key: pk_live_xxx" "https://api.pakdatahub.com/v1/trade/hs?flow=export&code=10063010"
Find codes by name with the public /v1/trade/products?q= (q=basmati, q=cotton yarn, q=5205) or search with kinds=trade_product.