Bahrain Import Data API
Pricing
from $1.60 / 1,000 import records
Bahrain Import Data API
Unofficial Bahrain import data API: monthly non-oil imports of Bahrain by 8-digit HS code and country of origin, with value, weight, quantity and unit values. Data from the Bahrain Open Data Portal.
Pricing
from $1.60 / 1,000 import records
Rating
0.0
(0)
Developer
Sourcing Data Studio
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
15 days ago
Last modified
Categories
Share
See what Bahrain imports, from where, and at what declared price, before you enter the market. Bahrain Import Data API returns the monthly non-oil imports of Bahrain by 8-digit HS code and country of origin from the Bahrain Open Data Portal: value in BHD and USD, weight, quantity and unit values. Use it to size demand and compare origins. You pay only for records saved.
Unofficial: not affiliated with or endorsed by the Information & eGovernment Authority or the Government of Bahrain.
Datasets provided by the Information & eGovernment Authority via www.data.gov.bh are governed by the Bahrain Open Government Data License available at www.nea.gov.bh/Documents/OpenDataLicense.pdf. To the fullest extent permitted by law, the government is not liable for any damage or loss of any kind caused directly or indirectly by the use or availability of the datasets or any derived analyses or applications. Datasets provided by the iGA via www.data.gov.bh are governed by the Terms of Use available at www.data.gov.bh/en/TermsOfUse.
Every record names its dataset and the time it was retrieved. Renaming, sorting, rounding, the two unit values and the three code levels (hs6, hs4, hsChapter) are done by this Actor. Any analysis or transformation of the data is ours and is not attributed to the Information & eGovernment Authority.
What does Bahrain Import Data API do?
- Works as a Bahrain open data API for one topic: it reads the yearly import datasets of the Bahrain Open Data Portal for the years 2021 to 2026.
- Filters by HS code prefix (2 to 8 digits), by keyword in the English commodity description, by country of origin, by year and by month.
- Works as a Bahrain trade statistics API for products: ask for "8517" to get Bahrain imports by HS code for telephone sets, or for "smartphone" to find them by name.
- Computes two unit values for you: USD per kilogram and USD per unit.
- Adds
hs6,hs4andhsChapter, the first 6, 4 and 2 digits of the commodity code, so that years with different 8-digit lines can still be grouped. - Returns the newest period first and, inside a period, the largest value first. A low limit therefore gives you the most recent and biggest records.
- Removes exact duplicates and rejects incomplete records before they are saved.
- Charges one event per saved record. Failed requests, duplicates and invalid records are never charged.
- Asks the portal politely: one request at a time, at least a second apart, under its own name. If the portal refuses a request, the run stops and does not try another address.
- Writes a run summary with the source, the datasets, the licence statement, totals and failures to the key-value store.
- Works from Apify Console, the Apify API, n8n, Make and AI agents through the Apify MCP server.
What data can you get with Bahrain Import Data API?
Use this Bahrain import data API to get Bahrain customs import data in the form the portal publishes it: one record per month, 8-digit commodity code and country of origin. It covers Bahrain HS code import statistics and Bahrain imports from China, India, Saudi Arabia and any other origin. Each row also carries hs6, hs4 and hsChapter, which this Actor derives from the commodity code.
| Field | Type | Description |
|---|---|---|
year | integer | Calendar year of the import period. |
month | integer | Month of the import period, 1 (January) to 12 (December). |
period | string | Import period as year and month, for example 2025-02. |
hsCode | string | 8-digit commodity code (HS-based customs tariff code) as published by the portal. The 8-digit lines are renumbered between HS editions, so use hs6 as the key for a series over several years. |
hs6 | string | Computed by this Actor: the first 6 digits of hsCode, the HS subheading shared internationally. The stable key for a series over several years, because the 8-digit lines are renumbered between HS editions. Null when hsCode has fewer than 6 digits. |
hs4 | string | Computed by this Actor: the first 4 digits of hsCode, the HS heading. |
hsChapter | string | Computed by this Actor: the first 2 digits of hsCode, the HS chapter, with its leading zero (for example 09). |
commodity | string | Commodity description in English, as published. |
commodityArabic | string, optional | Commodity description in Arabic, as published. |
originCountryCode | string | Country of origin as a 2-letter ISO 3166-1 code, for example CN. |
originCountry | string | Country of origin name in English, as published. |
valueBhd | number | Declared import value in Bahraini dinar (BHD), rounded to 3 decimals. A few correction records are negative. |
valueUsd | number | Declared import value in US dollars, as published, rounded to 2 decimals. A few correction records are negative. |
weightKg | number, optional | Imported weight in kilograms, rounded to 6 decimals. |
quantity | number, optional | Imported quantity in the statistical unit of the commodity, rounded to 6 decimals. |
unit | string, optional | Statistical unit of the quantity as published, for example NO (number of items) or KG. |
unitValueUsdPerKg | number, optional | Computed by this Actor: valueUsd divided by weightKg, rounded to 4 decimals. Null when weightKg is 0 or missing, or when the value is negative. |
unitValueUsdPerUnit | number, optional | Computed by this Actor: valueUsd divided by quantity, rounded to 4 decimals. Null when quantity is 0 or missing, or when the value is negative. |
datasetId | string | Id of the yearly dataset on the Bahrain Open Data Portal that the record comes from. |
source | string | Source domain of the data. |
publisher | string | Publisher of the data: Information & eGovernment Authority, Kingdom of Bahrain. |
retrievedAt | string | ISO 8601 time when the record was retrieved. |
unitValueUsdPerKg and unitValueUsdPerUnit are not in the source. This Actor computes them as the declared USD value divided by the weight or the quantity. They are averages of declared values for the whole record, not market prices. hs6, hs4 and hsChapter are the first 6, 4 and 2 digits of hsCode.
How to use Bahrain Import Data API
- Click Try for free on this page.
- Enter one or more HS commodity codes (for example
8517), or Search keywords. At least one of the two is required. - Optionally add Countries of origin as 2-letter codes (for example
CN), the Years and the Months. - Set Maximum import records. The run stops as soon as that many records are saved.
- Click Start. Results appear in the Output tab while the run is going.
- Download the results as JSON, CSV or Excel, or read them through the API.
If you give both codes and keywords, a record must match a code and a keyword. Several codes, keywords or countries in one list are combined with OR.
Input examples
Phones from china and india
{"hsCodes": ["8517"],"originCountries": ["CN","IN"],"years": [2025],"months": [10,11,12],"maxItems": 100}
Keyword search two years
{"searchQueries": ["smartphone"],"years": [2024,2025],"maxItems": 200}
Unit values by origin three years
{"hsCodes": ["85171300"],"years": [2023,2024,2025],"maxItems": 500,"feedback": "Example: please add a monthly total per origin country."}
Output example
These rows come from a real run of the quick-test example.
[{"year": 2025,"month": 12,"period": "2025-12","hsCode": "85171300","hs6": "851713","hs4": "8517","hsChapter": "85","commodity": "Smartphones","commodityArabic": "أجهزة هاتف ذكية (سمارت فون)","originCountryCode": "CN","originCountry": "CHINA","valueBhd": 13797873.86,"valueUsd": 36696473.02,"weightKg": 27434.266,"quantity": 59084,"unit": "NO","unitValueUsdPerKg": 1337.6145,"unitValueUsdPerUnit": 621.0899,"datasetId": "import-1-2025","source": "data.gov.bh","publisher": "Information & eGovernment Authority, Kingdom of Bahrain","retrievedAt": "2026-10-06T03:59:44.420Z"},{"year": 2025,"month": 12,"period": "2025-12","hsCode": "85176290","hs6": "851762","hs4": "8517","hsChapter": "85","commodity": "OTHER ELECTRICAL APPARATUS FOR LINE TELEPHONY OR LINE TELEGRAPHY","commodityArabic": "اجهزة اخرى كهربائية للهاتف ( تلفون ) او البرق (تلغراف) السلكيين","originCountryCode": "CN","originCountry": "CHINA","valueBhd": 2362490.028,"valueUsd": 6283218.16,"weightKg": 33939.801,"quantity": 27725,"unit": "NO","unitValueUsdPerKg": 185.1283,"unitValueUsdPerUnit": 226.6264,"datasetId": "import-1-2025","source": "data.gov.bh","publisher": "Information & eGovernment Authority, Kingdom of Bahrain","retrievedAt": "2026-10-06T03:59:44.420Z"},{"year": 2025,"month": 12,"period": "2025-12","hsCode": "85176220","hs6": "851762","hs4": "8517","hsChapter": "85","commodity": "OTHER APPARATUS FOR CURRENT LINES CONDUCTORS SYSTEMS OR DIGITAL LINES SYSTEMS","commodityArabic": "أجهزة أخرى لانظمة خطوط التيار الناقل او لانظمة الخطوط الرقمية","originCountryCode": "CN","originCountry": "CHINA","valueBhd": 329179.055,"valueUsd": 875476.21,"weightKg": 5856.244,"quantity": 6813,"unit": "NO","unitValueUsdPerKg": 149.4945,"unitValueUsdPerUnit": 128.5008,"datasetId": "import-1-2025","source": "data.gov.bh","publisher": "Information & eGovernment Authority, Kingdom of Bahrain","retrievedAt": "2026-10-06T03:59:44.420Z"}]
How much does Bahrain Import Data API cost?
| Event | You pay for | Free | Bronze | Silver | Gold |
|---|---|---|---|---|---|
| Import record | One monthly import record (commodity code, origin country, value, weight, quantity) saved to the dataset. Failed requests and invalid rows are never charged. | $0.002 | $0.002 | $0.0018 | $0.0016 |
Prices are per event. Your tier follows your Apify subscription plan.
On the Free tier, $0.002 per import record means:
- 100 import records cost $0.20.
- 1,000 import records cost $2.00.
Apify also charges a tiny start fee per run (apify-actor-start, $0.00005 per GB of memory). Failed requests, duplicates and invalid records are never charged. To cap your spending, set Maximum cost per run in the run options; the run stops cleanly when that budget is used.
Use Bahrain Import Data API from the API, n8n, Make or an AI agent
Apify API
Run the Actor and get the import records in one call:
curl -X POST "https://api.apify.com/v2/acts/sourcing-data-studio~bahrain-import-data-api/run-sync-get-dataset-items" \-H "Authorization: Bearer YOUR_APIFY_TOKEN" \-H "Content-Type: application/json" \-d '{"hsCodes":["8517"],"originCountries":["CN","IN"],"years":[2025],"months":[10,11,12],"maxItems":100}'
n8n and Make
Use an HTTP request module with the same URL, method POST and a JSON body like the input examples above. Store your Apify API token as a credential, never in the workflow itself.
AI agents through the Apify MCP server
Connect your agent to the Apify MCP server and call sourcing-data-studio/bahrain-import-data-api with the same input. Agents can use the Feedback for the developer field to report missing fields or problems.
For AI agents
- Minimal call:
{"hsCodes":["8517"],"maxItems":10}. At the Free price, 10 records cost $0.02, plus Apify's start fee. Records that are not saved are never charged. - Read these fields first:
period,hs6,originCountryCode,valueUsdandunitValueUsdPerKg. - Outcomes: the run status message says how many records were saved. The
RUN_SUMMARYrecord in the run's key-value store haslistings, one status per year (ok,no-match,blocked,failedorstopped), the failed requests andstoppedBy(timeout,request-limitorrefused). - Do not use it for exports, oil trade, importer names or current prices: the portal publishes monthly declared values of non-oil imports by product and origin, nothing more.
- Call it through the Apify MCP server as the tool
sourcing-data-studio/bahrain-import-data-apior through the Apify API.
Limits
- At most 10,000 import records per run. For more, run the Actor several times, for example one run per year or per group of HS codes.
- The portal allows anonymous requests up to a daily quota per address (the portal does not publish the number). A run needs about one request for each 100 records, plus one overview request per year and at least one request per month, so this is rarely a limit. The proxy is off by default for that reason: addresses of a shared proxy are used by many people and their quota can already be used up. A proxy is never used to get round a refusal. After HTTP 429 with a wait time of up to 60 seconds the Actor waits and asks again from the same address. When the quota is used up, or the portal refuses a request (HTTP 401, 403 or 407), the run stops, keeps the records already saved, charges nothing for the refused request and tries no other address. If the run summary reports HTTP 429, run again later, after the portal's daily quota resets.
- Years are 2021 to 2026. 2026 is a partial year that grows as the Authority publishes new months, and the newest months of any year may lag behind. Each year is a separate dataset on the portal, so a new year is added to this Actor only after the portal has published it (checked each January).
- The data covers non-oil imports as the portal publishes them. Values are declared values; they can contain a few correction records with negative values, which are kept. The unit values of such records are empty.
- Keywords match whole words and word beginnings in the English description ("smartphone" finds "Smartphones"). A misspelling finds nothing, and the portal does not search inside a word. HS codes are the more reliable filter.
- A run that reaches its timeout stops cleanly and keeps what it saved. The status message then says that the result is incomplete, and the run summary has
stoppedByset totimeoutand the statusstoppedfor the years that were not read to the end. - Records are de-duplicated within a run, not across runs.
- Codes change between years. Each year is a separate dataset, and the 8-digit lines are renumbered between HS editions, so the same 8-digit code can describe another product in another year and a product can move to a new code. For a series over several years use
hs6, the first 6 digits, as the stable key (hs4andhsChaptergroup more coarsely), and compare the descriptions of the years you join.hs6itself changes when a new HS edition starts: mobile phones are 851712 in 2021 and 851713 (smartphones) from 2022. - The portal and its columns are maintained by the Authority and can change. The Actor reads the yearly datasets it knows, and shows a failed request in the run summary instead of guessing.
FAQ
Which data does Bahrain Import Data API collect?
Only open statistical data published on the portal: month, HS commodity code, commodity description in English and Arabic, country of origin, import value in BHD and USD, weight, quantity and unit. It needs no login and no API key.
Which data is not collected?
No names of importers, companies or private individuals, no contact persons, phone numbers or email addresses, no exports and no oil trade. The Actor reads only the columns listed in the table above and ignores everything else in a record.
Can I use the data commercially?
The Bahrain Open Government Data License v1.0 allows sharing, adapting and commercial use of the datasets, if you state the source and the extraction date and make clear that your analysis is yours and not the Authority's. Each record carries datasetId and retrievedAt, and the run summary has an attribution field with the full text. Read the licence at www.nea.gov.bh/Documents/OpenDataLicense.pdf for the exact terms.
Is a program allowed to read the portal's API?
Yes. The portal's FAQ says you can access the data by connecting to it through the Application Programming Interface (API), and the licence allows commercialising the applications that you develop using the datasets. The portal's robots.txt, the standard file of its software platform, says Disallow: /api/ for all user agents except Googlebot. Those rules are meant for crawlers. This Actor does not crawl: it calls the documented records endpoint of six fixed datasets, one request at a time, under its own name. If the portal refuses a request or its daily quota is used up, the run stops; nothing is charged for the refused request, and records saved before it stay charged. If the Information and eGovernment Authority asks us to stop, we stop (licence clause 3.3(e)).
Why did my run return 0 records?
No record matched your codes, keywords, countries, years and months, or the portal did not answer or refused a request. The Storage tab holds the run summary with the months found for each year and every failed request. Nothing is charged in either case.
How are the unit values calculated?
unitValueUsdPerKg is valueUsd divided by weightKg, and unitValueUsdPerUnit is valueUsd divided by quantity, both rounded to 4 decimals. Weight and quantity are rounded to 6 decimals. A unit value is empty when weightKg or quantity in the same record is 0 or missing, or when the value is negative. The unit field tells you what one unit is, for example NO for a piece.
Can I schedule Bahrain Import Data API?
Yes. Save your input as a task and add a schedule in Apify Console, for example once a month after the new month is published.
Feedback
Tell us what to add next in the Feedback for the developer input field, or open an issue in the Issues tab. Feedback is saved with the run summary.