# Changelog of Bahrain Import Data API (`sourcing-data-studio/bahrain-import-data-api`) Actor

- **URL**: https://apify.com/sourcing-data-studio/bahrain-import-data-api/changelog.md
- **Full Actor documentation**: https://apify.com/sourcing-data-studio/bahrain-import-data-api.md

## Changelog

### Unreleased

- A refusal by the portal never changes the IP address. HTTP 401, 403 and 407 are not retried: the request is recorded once as blocked, and nothing is charged. After HTTP 429 the Actor waits as long as the portal asks (Retry-After, up to 60 seconds) and asks again from the same address. A longer wait, or the header x-ratelimit-remaining: 0, ends the request, with or without a proxy. No session is retired and no other proxy address is used because of a refusal: a run uses one session.
- A request that the portal refused ends the run. Nothing more is asked, the records already saved are kept and charged, the years not read to the end get the status `stopped`, and `stoppedBy` in the run summary is `refused`. Before, the run went on with the next month or year.
- The run summary records the value of the portal's x-ratelimit-limit header (`rateLimit.limit`) when the portal sends one. The attribution text in the run summary and the README now also hold the sentence of the portal's Terms of Use (clause 5(c)) next to the licence statement.
- New fields in every row: `hs6`, `hs4` and `hsChapter`, the first 6, 4 and 2 digits of `hsCode`. The 8-digit lines are renumbered between HS editions, so `hs6` is the key for a series over several years. The README limit about codes says so.
- README and Store listing: the figure of 5,000 requests per day is gone (the portal does not publish its quota), the README no longer advises a proxy after HTTP 429, and the input texts for the proxy and the retries match the new behaviour. New "For AI agents" section and a FAQ entry on reading the portal's API. New first paragraph, SEO title, SEO description and search terms.

### 0.1 (2026-10-05)

- First version: Bahrain import data API for monthly non-oil imports by 8-digit HS code and country of origin (years 2021 to 2026), from the Bahrain Open Data Portal, with value in BHD and USD, weight, quantity and computed unit values.
- Weight and quantity keep 6 decimals, so very small amounts are no longer shown as 0 next to a unit value.
- The proxy is off by default. The portal counts requests per IP address, and shared proxy addresses share one allowance.
- "Retries per request" now also limits retries after connection errors. Requests are at least 1 second apart.
- A run that stops before its timeout says so in the status message and in the run summary (stoppedBy).
- A run that is started again after a platform migration continues where it stopped and does not save records twice.
- The selectable years (2021 to 2026) now follow the list of yearly datasets that the Actor reads, so a new year can be chosen only after its dataset has been added. Inputs and results are unchanged.
