# Search Kongfz — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search for used books on Kongfz by keyword or ISBN to discover available listings with pricing, condition ratings, and seller information. Find affordable secondhand books across thousands of sellers in China's largest used book marketplace.

**Category:** Marketplaces | **Website:** [search.kongfz.com/product/?dataType=0&keyword=9787540418250](https://search.kongfz.com/product/?dataType=0&keyword=9787540418250) | **Docs:** [parse.bot/marketplace/2135a702-0962-403a-b081-4499343833ae/search-kongfz-com-api](https://parse.bot/marketplace/2135a702-0962-403a-b081-4499343833ae/search-kongfz-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-search-kongfz-com-api-2135a702/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_category_facets

Returns the total number of listings in a given category plus all available facet groups (subcategories, condition/品相, stock) with their names and listing counts. Each facet group contains an array of facets with name, count, and optionally a sub-category ID for navigation.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `cat_id` | integer | Yes | Category identifier (e.g. 1 for 图书, 8 for 线装古籍, 9 for 民国旧书). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-search-kongfz-com-api-2135a702/get_category_facets \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cat_id":"<integer>"}'
```

### get_category_listings

Returns a page of product listings for a given Kongfz category. Each listing includes title, author, publisher, ISBN, price, item_id, and cat_id. The response also includes the total number of listings found. Some sort types and deep pages may require authentication and return a login-required error from the upstream API.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `cat_id` | integer | Yes | Category identifier (e.g. 6001 for 英文书, 6002 for 日文书, 6004 for 俄文书). |
| `page` | integer | No | Page number for pagination. |
| `sort_type` | string | No | Sort type code passed to the upstream API (e.g. '1' for sales, '4' for default, '5' for price ascending). Some values like '3' require login and will return an upstream error. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-search-kongfz-com-api-2135a702/get_category_listings \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cat_id":"<integer>","page":"<integer>","sort_type":"<string>"}'
```

### search_books

Search for used book listings by keyword or ISBN. Returns all matching product listings with title, author, publisher, ISBN, price in RMB, condition/品相, seller/shop name, and direct listing URL. Results are paginated. Pagination via integer page counter; each page returns up to page_size items. Empty results are possible for obscure queries.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `keyword` | string | Yes | Search keyword — can be a book title, author name, or ISBN (e.g. '9787540418250' or '三体'). |
| `page` | integer | No | Page number for pagination. |
| `page_size` | integer | No | Number of results per page, between 1 and 50. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-search-kongfz-com-api-2135a702/search_books \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"keyword":"<string>","page":"<integer>","page_size":"<integer>"}'
```
