BİM API workflow: from the leaflet list to product rows
The usual path starts with the list of sheets, because a leaflet key comes from there.
- Call
bim-leaflets, withbody.typeset toaktuelorindirimto list one family. - Choose an entry by its
statusandstarts_on, and copy itsleaflet_key. - Send that key as
body.leaflet_keytobim-leaflet-products. - Read
products, and usecountandprice_rangeto see the size and the price span of the sheet.
Because BİM keeps no archive, a key that is no longer listed is rejected, so fetch the list again before each run instead of storing keys.
Preview upcoming BİM leaflets
A sheet can be read before it starts, by one of two routes.
- Call
bim-leafletsand keep the entries whosestatusisupcoming; theirstarts_onshows when each sheet begins. - Either send the
leaflet_keyof an entry tobim-leaflet-products, or send a date inside that entry's run asbody.date, withbody.typeset to the entry'stype.
The date route returns the sheet BİM publishes for that day. For indirim, when a date is covered by both a long sheet and a weekly one, the one that starts nearest to the date is returned, so use the key route to read the other.
Work out which BİM leaflet is current today
The leaflet list holds what is needed to decide which sheet applies today.
- Call
bim-leafletsand readtoday, the date in Istanbul. - Compare it with
starts_onandends_onof each entry, or readcurrent_leaflet_keyfor the sheet BİM's own site is showing. - Use
days_from_todayto see how far an entry lies from today, andweekdayfor the day of the week.
BİM prints only day and month on its leaflets, so the year in starts_on and ends_on is inferred, and year_inferred marks it. Both families run at once, so send body.type as aktuel or indirim to keep one calendar per family.
Build a weekly price feed from leaflet products
A price feed reads the same fields from each sheet and treats the empty values on purpose.
- Read the sheet on shelf with
body.typeset toindirim, and again withaktuel. - Store
product_id,title,priceandcurrencyfor each entry ofproducts. - On
indirimrows also storeprice_before_discountanddiscount_percent_calculated; onaktuelrows both are null. brandis null when BİM left its brand field empty, and the brand is then often insidetitle.- Keep
products_without_priceandbanner_tilesapart, because they are not priced products.
discount_percent is BİM's printed figure and truncates, so prefer discount_percent_calculated when the exact value matters.
Look up one product and read its brand
After a leaflet read, a product can be opened on its own.
- Take
urlorslugfrom a row ofbim-leaflet-products. - Send it as
body.urlorbody.slugtobim-product-detail. - Read
productforpackage_size,features,priceandimages. - Read
brandandbrand_source: withbody.include_brandat its default, the brand comes from the product's leaflet andbrand_sourcereadsleaflet.
Send body.include_brand as false when only the product page is needed. The brand is then null and brand_source reads not_requested, which saves the extra read of the leaflet.
Find BİM stores from province to district
Store addresses are collected in three calls, each one level deeper.
- Call
bim-storeswithout inputs and read the provinces with theiridandname. - Send a province name or its
idasbody.cityto read its districts. - Send a district name or its
idasbody.countytogether withbody.cityto read the stores. - Keep
nameandaddressof each store, with itscityandcounty.
Names such as İstanbul and Kadıköy work as written, and reported_count is the store count BİM itself reports, so it can be kept next to count.
Fetch leaflet pages as images
Poster images come from one call, and a second call matches them to rows.
- Call
bim-posterswithbody.typeset to the tab you need:aktuel,indirimorkirtasiye. - Match a poster to its campaign with
label,starts_onandends_on. - Download
cover_imagefor a thumbnail andpage_imagesfor the pages in order;page_countshows how many pages there are. - Use
download_urlwhen BİM's own download link is wanted instead of single images.
A poster is the printed sheet, so it carries no structured prices. To get the same campaign as rows, read bim-leaflets for its key and send it to bim-leaflet-products.
List BİM own-label brands by category
Own-label brands take two calls, the second one narrowed by a category.
- Call
bim-brandswithout inputs and readcategories, BİM's eleven product categories. - Pick one entry and send its
slug, or its numeric id, asbody.category. - Read
brandsfor the names andlogoof the own-label brands, anddescriptionfor BİM's text about the category.
This operation returns brand names and logos only; products and prices come from bim-leaflet-products.
How BİM works
BİM's website groups its weekly campaigns into Aktüel Ürünler sheets, labelled by sale day, and İndirim sheets, labelled by a date range. A section called Afişler (posters) shows the same listings. Aktüel ürünler are dated weekly campaign products, a mix of appliances, home goods, clothing, toys and some groceries, put on sale on set weekdays such as Tuesday, Wednesday or Friday.
The Kırtasiye sheet is BİM's back-to-school stationery campaign of notebooks, pens, school bags and art supplies, including its own Studi brand. Turkish news outlets publish BİM aktüel catalogs, listing their sale dates and the products arriving in stores.
[
{
"body": {
"type": "all"
}
},
{
"body": {
"leaflet_key": 1667
}
}
][
{
"body": {}
},
{
"body": {
"city": "İstanbul"
}
},
{
"body": {
"city": "İstanbul",
"county": "Kadıköy"
}
}
]{
"body": {
"type": "kirtasiye"
}
}{
"body": {
"slug": "darel-calisma-masasi-14-9",
"include_brand": false
}
}Server-side request template
This server-side template shows authentication and request identity using the first operation of this API. Choose the operation for your use case and check its current availability and price on the API page. After a timeout, resend the unchanged request with the same Idempotency-Key.
The gateway request is always POST.
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.
# 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"}}'Integration checklist
- The API key is stored in a server-side secret manager and never sent to a browser.
- Each request carries its own Idempotency-Key, kept until the request has a final answer.
- The integration reads ok and error.code and handles each error code as the error table describes.
- An uncertain POST is inspected using its original identity, never blindly repeated with a new one.
- The operation’s current availability and price have been checked on its API page.
BİM API overview and prices · Read the API reference · Try it in the playground