From a typed fragment to an A101 API product record
A search box can start with a101-suggest and end with a product record:
- Send the letters typed so far, such as
peyn, and show the returned products, categories and, on Ekstra, brands while the user keeps typing. - Once a full word is chosen, call
a101-searchwith that word asqueryto get a page of rows. - Pass the
product_idof the row the user picks straight intoa101-product-detail, together with the samechannel, so that the record comes from the shop the row came from.
Passing the row's url instead works as well, since an address settles the shop on its own. Keeping the channel through the whole chain avoids reading a product in one shop and its price in the other.
Paging A101 API search and campaign results
Search and campaign listings return 60 products per page, and page starts at 1. To read further pages:
- After the first answer, read
total_pagesandhas_more. - Request the next page while
has_moreshows that another follows, and stop attotal_pages. - Keep the query, campaign, channel and sort identical on each request, because a change in any of them starts a different list.
Paging stops at page 200, so a long keyword result is read up to that window and not past it. On a search total_results can be null, so rely on total_pages and has_more to control the loop rather than dividing a total yourself.
Matching a campaign to the right shop
Each campaign value belongs to particular shops, and the pairing decides what a listing can contain:
aldin_aldinruns in both Kapıda and Ekstra, so it can be listed with eitherchannel.aldin_aldin_ekstrabelongs to Ekstra.haftanin_yildizlari,aldin_aldin_x,aylik_firsat,sepette_10_tlandcok_al_az_odebelong to Kapıda, which is also the default shop.
A weekly deals page therefore calls a101-campaigns once per campaign it shows, with the shop that runs it. The campaigns array on each row repeats the badges with their starts_on and ends_on dates, so a page can show when each promotion ends without a further request.
Reading A101 prices without mixing them up
A Kapıda row can carry several price figures, and only one of them is the shelf price.
| Field | What it tells you |
|---|---|
price | what the product costs on the shelf of the delivery store |
basket_offer.price | a price that applies only when the basket meets the offer's condition, so storing it as the product's price would understate it |
multi_buy.unit_price | a price that applies once the quantity reaches min_quantity |
unit_price | the price per unit, for comparing pack sizes |
price_before_discount, discount_percent | the struck price and its discount, not a basket deal |
Keep these figures in separate columns, and record the ends_on dates of the offers so that expired deals can be told apart from the shelf price.
When an A101 keyword has no matches
A keyword that A101 cannot match does not lead to an empty page in the shop: the shop fills the page with unrelated products. By default a101-search drops these rows, so results may be short or empty while fallback_results_dropped reports how many rows were removed. An empty results list is then a valid answer that says the keyword found nothing.
If you want to show the shop's substitutes, set include_fallback_results to true and read them from fallback_results, with fallback_total beside them. Use keyword_matches_on_page and page_notice to decide whether a page holds genuine matches before showing it as search results.
Tracking one A101 product over time
To follow a single item, store its product_id and its shop, then call a101-product-detail on a schedule that suits you. Each answer gives the current price, price_before_discount, discount_percent and in_stock, and the campaigns array shows the promotions attached to the product with their dates. campaign_period names the campaign and its date range on the product page.
For Ekstra items, stock_count and stock_level let you follow stock as well. When other_channel_offer is present, the same answer also gives the price in the other shop, so one call per item gives both prices. Compare like with like: a Kapıda price is the delivery store's price and can differ from Ekstra's.
Sorting Ekstra results in the A101 API
Sorting is an Ekstra feature. With channel set to ekstra, sort can put the lowest or highest prices first, the newest listings first, the biggest discounts first or the best sellers first, and without it the results follow A101's recommended order.
Kapıda's search has no working sort, so a Kapıda request keeps relevance; any other order is rejected there instead of being ignored. To find the cheapest grocery items, page through a Kapıda search and order the rows by price in your own code.
A101 in brief
Aldın Aldın is the chain's weekly promotional catalogue, and its items, mostly non-food and durable goods such as televisions, washing machines and cookware, go on sale in stores on Thursdays. Haftanın Yıldızları, which means Stars of the Week, is a weekly discount list that runs from Friday to Thursday and centres on groceries and household staples such as yogurt, cheese, eggs, tea and detergent.
Turkish news outlets publish the catalogue products week by week for shoppers who follow the deals. The A101 app brings Kapıda, Ekstra and the Artı loyalty programme together in one place.
[
{
"body": {
"query": "peyn",
"channel": "kapida"
}
},
{
"body": {
"query": "peynir",
"channel": "kapida",
"page": 1
}
},
{
"body": {
"product_id": "12002661",
"channel": "kapida"
}
}
]{
"body": {
"query": "televizyon",
"channel": "ekstra",
"sort": "discount",
"page": 1
}
}{
"body": {
"query": "deterjan",
"channel": "kapida",
"include_fallback_results": true
}
}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/a101/a101-campaigns' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{}'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.
A101 API: Kapıda groceries and Ekstra products overview and prices · Read the API reference · Try it in the playground