Documentation
BİM API technical reference
Reference for the BİM API: how a leaflet is chosen, what each input does and what the leaflet, poster, product, brand and store results contain.
See also: BİM API overview and prices · BİM API guide: leaflets, products, posters and stores
On this page
BİM API leaflet list: keys, dates and status values
bim-leaflets is the only place where a leaflet key comes from, because BİM keeps no archive and answers only the keys of the sheets it currently lists. body.type narrows the list to one family, and the list holds recent, current and upcoming sheets. Each entry of leaflets has these fields:
leaflet_key: the id to send asbody.leaflet_keytobim-leaflet-productstypeanddate_label: the family and BİM's own date textstarts_onandends_on: ISO dates with an inferred year, because BİM prints only day and month, whichyear_inferredshowsweekday,is_currentanddays_from_today: the weekday, whether the sheet is the current one and its distance in days from todaystatus:current,upcoming,todayorpast, wherecurrentis the sheet BİM's own site is showingurl: the address of the sheet
Next to the entries, current_leaflet_key holds the key of the current sheet, today is the date in Istanbul and types_present names the families that appear.
Fields in this section (2)
bim-leaflets, body.type
Selecting the leaflet to read
bim-leaflet-products reads one leaflet per call and offers three ways to choose it. body.leaflet_key names the sheet by id, body.date asks for the sheet BİM publishes for that day, and sending neither returns the sheet on shelf today. body.type matters only when no key is sent, and it is ignored when body.leaflet_key is present.
For a key that bim-leaflets does not list, BİM renders its current leaflet, so the operation rejects such a key instead of returning the wrong week's products.
BİM keeps a long indirim sheet and a weekly one going at once. When a date falls in both runs, the sheet that starts nearest to the date is returned, and a key from bim-leaflets reads the other one. Future dates work, since BİM publishes upcoming leaflets days ahead.
Fields in this section (4)
bim-leaflet-products, body.leaflet_key, body.date, body.type
Product row fields and discount figures
In a product row of bim-leaflet-products, price is a number in TRY and currency repeats the currency. Three fields carry the discount, and they differ in how they are made:
price_before_discount: the struck price, filled onindirimleaflets and null on everyaktuelleaflet, where BİM prints nonediscount_percent: the percentage as BİM prints it, which truncatesdiscount_percent_calculated: the exact arithmetic on the two prices, null when there is no struck price
The other fields of a row identify the product: product_id, title, image, slug and url. The leaflet block of the result repeats the sheet fields that bim-leaflets gives for each entry.
brand is null when BİM left its brand field empty, and such a brand often sits inside title. products_without_price lists products BİM prints without a price, and banner_tiles holds advert tiles never counted as products.
Fields in this section (1)
bim-leaflet-products
Poster tabs and what a poster holds
bim-posters takes body.type to pick the poster tab, and leaving it at its default returns the posters of every tab. A poster is the scanned printed sheet. In posters, type names its tab, label is BİM's date label and cover_image is the front image.
page_images lists the page images in order, page_count shows how many pages the poster has and download_url is BİM's own link for the sheet. count counts the posters, counts_by_type splits that count by tab and total_pages is the page total. bim-leaflet-products returns the same campaign as structured rows, but it takes only aktuel and indirim as body.type.
Fields in this section (2)
bim-posters, body.type
Finding one product by URL or slug
bim-product-detail finds a product by body.url, the product address, or by body.slug, the slug part alone, and product_url is accepted as an alternative name for body.url. BİM product pages live only while their leaflet does, so take a fresh value from bim-leaflet-products instead of storing one. A lookup of a product whose leaflet has expired is rejected.
body.include_brand controls one extra read of the product's leaflet. When it is true, brand and the leaflet block are filled; when it is false, only the product page is read, brand and leaflet are null and brand_source reads not_requested. The product block holds:
product_id,title,package_size,slugandurl: the product's identity and pack sizefeatures: the feature bullets, which often run longer than the leaflet tile'sprice,price_before_discount,discount_percentanddiscount_percent_calculated: the price figures, read as in a leaflet product rowcurrencyandmax_interest_free_installments: TRY and the highest number of interest-free instalmentsimageandimages: a single picture and the images of the product
Fields in this section (4)
bim-product-detail, body.url, body.slug, body.include_brand
Store finder levels and inputs
bim-stores goes one level deeper with each input, and without inputs it returns the 81 provinces BİM serves. body.city takes a province name or BİM's numeric province id, and body.county takes a district name or numeric district id, with district accepted as an alternative name for body.county. Without body.county the call returns the districts of the province, and a province on its own returns no stores, so a district is needed for them.
level tells which list came back, and each list has its own entries:
citiesandcounties: anidand anamefor each province or districtstores: thename,address,cityandcountyof each storereported_count: the store count BİM itself reports, next tocount
Fields in this section (3)
bim-stores, body.city, body.county
Brand categories and own-label brands
body.category takes a category slug or a numeric id from the categories list of this same operation, so the call without inputs comes first. Without a category the result is categories, and its entries give category_id, slug, name and url.
With a category the result is brands, whose entries give the brand name and a logo, together with category, which repeats the selected category, and description, which holds BİM's own text about it. level tells the two results apart and count counts the entries.
Fields in this section (2)
bim-brands, body.category
The max_rotations input
body.max_rotations is an advanced input that sets how many attempts an operation makes. A value outside its range is ignored and the default applies, so a request that sends one still runs. The same input exists on every operation of this API.
Fields in this section (1)
body.max_rotations
Operations
Every public gateway operation uses POST /api/v1/{project}/{action}.
Use a JSON object with the documented path, query, headers and body locations; omit unused locations. input.headers is JSON data for the operation, not browser request headers. Do not put credentials here. Keep body arrays, scalar values and null as documented; omission is different from null.
Own-label brands
POST /api/v1/bim/bim-brands
List BİM's product categories, then the own-label brand names and logos inside one category.
Input fields
| Field | Type | Required | Default | Allowed values | Limits |
|---|---|---|---|---|---|
body.category | string | Optional | — | — | — |
body.max_rotations | integer | Optional | 3 | — | 1–8 |
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/bim/bim-brands' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"category":"sut-ve-sut-urunleri"}}'Leaflet products
POST /api/v1/bim/bim-leaflet-products
Read the product rows of one leaflet with prices, package size, features and instalments.
Input fields
| Field | Type | Required | Default | Allowed values | Limits |
|---|---|---|---|---|---|
body.date | string | Optional | — | — | — |
body.leaflet_key | integer | Optional | — | — | 1–9007199254740991 |
body.max_rotations | integer | Optional | 3 | — | 1–8 |
body.type | string | Optional | "aktuel" | "aktuel""indirim" | — |
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/bim/bim-leaflet-products' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"type":"aktuel"}}'Leaflet list
POST /api/v1/bim/bim-leaflets
List the current, upcoming and recent leaflets with their keys, dates and status.
Input fields
| Field | Type | Required | Default | Allowed values | Limits |
|---|---|---|---|---|---|
body.max_rotations | integer | Optional | 3 | — | 1–8 |
body.type | string | Optional | "all" | "all""aktuel""indirim" | — |
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/bim/bim-leaflets' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"type":"all"}}'Leaflet posters
POST /api/v1/bim/bim-posters
Return the printed leaflet sheets as cover and page images with BİM's download link.
Input fields
| Field | Type | Required | Default | Allowed values | Limits |
|---|---|---|---|---|---|
body.max_rotations | integer | Optional | 3 | — | 1–8 |
body.type | string | Optional | "all" | "all""aktuel""indirim""kirtasiye" | — |
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/bim/bim-posters' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"type":"all"}}'Product detail
POST /api/v1/bim/bim-product-detail
Read one leaflet product by URL or slug with its images, feature list and brand.
Input fields
| Field | Type | Required | Default | Allowed values | Limits |
|---|---|---|---|---|---|
body.include_brand | boolean | Optional | true | — | — |
body.max_rotations | integer | Optional | 3 | — | 1–8 |
body.slug | string | Optional | — | — | — |
body.url | string | Optional | — | — | — |
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/bim/bim-product-detail' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"url":"https://www.bim.com.tr/aktuel-urunler/darel-calisma-masasi-14-9/aktuel.aspx"}}'Store finder
POST /api/v1/bim/bim-stores
List the provinces, the districts of a province and the stores of a district.
Input fields
| Field | Type | Required | Default | Allowed values | Limits |
|---|---|---|---|---|---|
body.city | string | Optional | — | — | — |
body.county | string | Optional | — | — | — |
body.max_rotations | integer | Optional | 3 | — | 1–8 |
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/bim/bim-stores' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"city":"İstanbul","county":"Kadıköy"}}'How calls work
POST /api/v1/bim/<action>withx-api-key,Content-Type: application/jsonand a requiredIdempotency-Key.- A successful call returns
ok: true:datais the result of the operation,meta.requestIdidentifies the recorded request andmeta.chargedCreditUnitsis the amount charged. Otherwiseokisfalseanderror.codenames the reason; readokanderror.coderather than relying on the HTTP status alone. Every gateway reply carries a request id for support:meta.requestId, or a top-levelrequestIdin a reply withoutmeta(such as a refusal before admission). - Charged the listed price only when a call succeeds. Failures are not charged; an unconfirmed outcome is released after at most 900 seconds without a charge.
- Repeating the same request with the same Idempotency-Key after it has finished returns the stored response for 24 hours without a new charge.
In the gateway reference: