# Gmarket API scraper — Korea's open marketplace (gmarket.co.kr): search listings, read the full listing (sale, list and coupon-applied price, options, seller, Smile/Star Delivery, shipping fee, rating, specs), page the reviews, and autocomplete. Prices in KRW. No account, no browser.

> Search gmarket.co.kr by keyword with the site's sorts and a price range. Each row is a listing: goods code, title, URL, image, sale price, struck list price and discount %, brand, seller name with grade badges and official-store flag, shipping fee / free shipping, Smile Delivery and Star Delivery badges, same-day dispatch note, search-index rating / review / purchase counts, and category codes. Ads are dropped by default and counted.
> ReefAPI engine `gmarket` · 4 endpoints · clean JSON, no scraping or browsers to manage.

## How to call
- **Endpoint:** `POST https://api.reefapi.com/gmarket/v1/<action>` with a JSON body.
- **Auth:** header `x-api-key: <YOUR_REEFAPI_KEY>` — create one free (1,000 credits, no card): https://reefapi.com/signup
- **Response (every call):** `{ ok: boolean, data: ..., meta: { record_count, credits, ... }, error: { code, message } }` — branch on `ok`. Failed calls are free except verified SHEIN NOT_FOUND on product/detail and price (4 credits).
- **One key + one shared credit pool** across every ReefAPI API. Per-call credits are listed on each endpoint below.
- **Use it from an AI agent (MCP):** connect `https://api.reefapi.com/mcp` (remote streamable-http, `Authorization: Bearer <key>`) and your assistant can call these actions directly.

## Endpoints

### POST /gmarket/v1/search — 2 credits
Search gmarket.co.kr by keyword with the site's sorts and a price range. Each row is a listing: goods code, title, URL, image, sale price, struck list price and discount %, brand, seller name with grade badges and official-store flag, shipping fee / free shipping, Smile Delivery and Star Delivery badges, same-day dispatch note, search-index rating / review / purchase counts, and category codes. Ads are dropped by default and counted.

**Parameters:**
- `query` (string, required) — Keyword to search on gmarket.co.kr. Korean works best ('샴푸', '노트북', '캠핑의자'); brand and model words in English also work ('nike', 'iphone').
- `page` (integer, optional, default 1) — Result page, 1-based (the site stops at 50). Under sort=relevance/popular/newest Gmarket repeats many rows from earlier pages; price_asc pages do not overlap.
- `sort` (enum, optional, default "relevance") — Order of the results, using the site's own orderings. The price orders search a much wider match set, so check keyword_matches_on_page. [one of: relevance, popular, newest, price_asc, price_desc]
- `price_min` (number, optional) — Lowest sale price in KRW (inclusive). Sent to Gmarket's own price filter and re-checked on the returned rows. Not combinable with a price sort.
- `price_max` (number, optional) — Highest sale price in KRW (inclusive).
- `include_sponsored` (boolean, optional, default false) — false (default): Gmarket's ad placements (파워클릭 / AI매출업) are dropped and counted in `sponsored_dropped`. true: they are returned in page order, flagged `is_sponsored`. `count` always counts organic rows only.
- `include_fallback_results` (boolean, optional, default false) — When no listing on the page contains a query word, Gmarket fills the page with unrelated popular listings. false (default): results are empty and `fallback_results_dropped` counts them. true: they are returned apart, in `fallback_results`.
- `max_rotations` (integer, optional, default 8) — Advanced: how many times to retry a difficult request (1-12, default 8).

**Returns:** results[]{position, product_id, title, url, image, price, currency=KRW, price_label, list_price, discount_percent (list→sale, 1 decimal, same as detail), discount_badge_percent (the card's own integer badge), coupon_price, brand, seller{name, grades[], is_official_store}, shipping_fee, free_shipping, smile_delivery, delivery_badge ('star_delivery'|'seller_star_delivery'), dispatch_note, search_index_rating, search_index_review_count, search_index_purchase_count, benefit_tags[], event_tags[], is_sold_out, category_codes{large, medium, small}, section, is_sponsored}, count (organic rows), sponsored_count, sponsored_dropped, total_results, total_pages, page, sort, query, applied_price_range, dropped_outside_price_range, duplicates_dropped, keyword_matches_on_page, fallback_results_dropped, fallback_total, fallback_results[] (only with include_fallback_results=true), page_overlap_expected, page_notice

**Example request body:**
```json
{
  "query": "샴푸"
}
```

### POST /gmarket/v1/product/detail — 1 credit
The full Gmarket listing by goods code or URL: title, brand, official-store and certification flags, sale price, struck list price and discount, the coupon-applied price (쿠폰적용가) with its coupons, the card-payment price, unit price, reward points, availability and purchase limit, rating, review / question / purchase counts, seller, Smile Delivery and Star Delivery, shipping fee with the free-shipping threshold and delivery estimate, the Gmarket-lowest-price flag and how many sellers list the same product, options with extra charges and stock, images, description, the legal product-information notice (specs) and category codes.

**Parameters:**
- `product_id` (string, optional) — Gmarket goods code (상품번호), 1-10 digits. Every search row returns it as `product_id`.
- `url` (string, optional) — Instead of product_id: a Gmarket product URL (m.gmarket.co.kr/vi/product/<code>, item.gmarket.co.kr/Item?goodscode=<code> or mitem.gmarket.co.kr/Item?goodsCode=<code>).
- `max_rotations` (integer, optional, default 8) — Advanced: how many times to retry a difficult request (1-12, default 8).

**Returns:** product{product_id, url, title, brand, is_official_store, is_certified, price_type, price, currency=KRW, list_price, discount_percent, coupon_price, coupon_discount_percent, applied_coupons[{coupon_no, amount}], card_payment_price, card_payment_price_label, unit_price_label, reward_points_max, member_extra_reward{label, points}, installment_note, in_stock, availability, purchase_limit, purchase_limit_note, rating, rating_scale, review_count, question_count, purchase_count, seller{id, name, shop_url}, smile_delivery, star_delivery ('fulfillment'|'seller'), item_types[], delivery{shipping_fee, free_shipping, free_shipping_threshold, delivery_estimate, overseas_shipping, notes[], extra_fees[]}, is_gmarket_lowest_price, same_product_offer_count, price_comparison_url, campaign, condition, origin, options[{type ('selection'|'combination'), names[], values[{option_no, value | values[], extra_price, stock, sold_out}]}], images[], description_text, description_images[], specs[{name, value}], category_codes{large, medium, small}}

**Example request body:**
```json
{
  "product_id": "3658351431"
}
```

### POST /gmarket/v1/product/reviews — 1 credit
Customer reviews of a Gmarket listing by goods code or URL: the premium (photo) or general list, paged, with the premium and general counts and the average rating. Each review carries its rating, title, text, the masked author id, date, the purchased option and photos.

**Parameters:**
- `product_id` (string, optional) — Gmarket goods code (상품번호), 1-10 digits. Every search row returns it as `product_id`.
- `url` (string, optional) — Instead of product_id: a Gmarket product URL (m.gmarket.co.kr/vi/product/<code>, item.gmarket.co.kr/Item?goodscode=<code> or mitem.gmarket.co.kr/Item?goodsCode=<code>).
- `type` (enum, optional, default "premium") — Which review list to page. Both counts are returned either way. [one of: premium, general]
- `sort` (enum, optional, default "popular") — Order of premium reviews. General reviews are always newest first, so a sort with type=general is rejected. [one of: popular, newest]
- `page` (integer, optional, default 1) — Review page, 1-based; 10 reviews per page. `total_pages` says how many exist.
- `max_rotations` (integer, optional, default 8) — Advanced: how many times to retry a difficult request (1-12, default 8).

**Returns:** reviews[]{review_id, rating, title, content, author, date, option, images[]}, count, type, sort, page, total_pages, page_size, premium_count, general_count, average_rating, rating_scale, product_id

### POST /gmarket/v1/search/suggest — 1 credit
Gmarket's autocomplete for a partial keyword: up to 10 keyword suggestions.

**Parameters:**
- `query` (string, required) — The partial keyword to complete.
- `max_rotations` (integer, optional, default 8) — Advanced: how many times to retry a difficult request (1-12, default 8).

**Returns:** suggestions[] (keywords), brands[{name, url}], count

**Example request body:**
```json
{
  "query": "아이폰"
}
```

## More
- Try it live, no code: https://reefapi.com/playground?engine=gmarket
- Human docs page: https://reefapi.com/docs/gmarket
- Overview page: https://reefapi.com/gmarket-api
- Every ReefAPI API in one file (for your AI): https://reefapi.com/llms-full.txt
