> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xapichina.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search listings

> Search Che168 listings with structured filters and page-based pagination.

## Behavior

Search returns up to 24 listings per upstream page. Follow `next_page` until it is `null`; there is no caller-selected search `limit`. Use vehicle age filters rather than `year_from` / `year_to`. Each successful page consumes one account-wide data request.

**Authentication:** Secret API key in `X-API-Key`. **Quota:** One successful call consumes one data request.

## Request example

```bash theme={"system"}
curl --fail-with-body "https://api.xapichina.com/v1/search?brand=BMW&page=1&lang=en" \
  -H "X-API-Key: $XAPICHINA_API_KEY"
```

## Illustrative response

The following example is abbreviated. It demonstrates the response shape rather than live inventory or guaranteed field coverage. The generated schema describes the complete contract.

```json theme={"system"}
{
  "total_count": 1,
  "page": 1,
  "limit": 24,
  "results": [
    {
      "id": "59967821",
      "title": "BMW 3 Series 2022 325Li",
      "year": 2022,
      "mileage_km": 32000,
      "price_cny": 188000,
      "price_eur": 24102.56,
      "location": "Shanghai",
      "source_url": "https://www.che168.com/dealer/0/59967821.html"
    }
  ],
  "next_page": null
}
```

Read the [integration guide](/pagination-and-filters) for parameter rules, source interpretation, and error handling. Use the generated request playground with your own server-side API key.


## OpenAPI

````yaml openapi.json GET /v1/search
openapi: 3.1.0
info:
  title: XAPI China
  description: >-
    Search Chinese used-car listings and retrieve vehicle details, photos,
    CNY/EUR prices, and supported provider-native inspection data.


    XAPI China is an independent service and is not affiliated with or endorsed
    by Che168.


    Authenticate data requests with X-API-Key. GET /v1/makes and GET /v1/filters
    are public. English responses are the default; use lang=zh for Chinese
    output.


    Inspection coverage is explicit. Insurance-event query evidence is not
    structured insurance claim history.


    Create keys and check your account-wide allowance in the XAPI China
    dashboard: https://xapichina.com/dashboard.
  version: 1.0.0
servers:
  - url: https://api.xapichina.com
    description: Production
security: []
paths:
  /v1/search:
    get:
      tags:
        - Search
      summary: Search Che168 used-car listings
      operationId: search_cars_v1_search_get
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 1
            title: Page
        - name: lang
          in: query
          required: false
          schema:
            enum:
              - en
              - zh
            type: string
            description: 'Response language: en (English) or zh (Chinese)'
            default: en
            title: Lang
          description: 'Response language: en (English) or zh (Chinese)'
        - name: q
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 100
              - type: 'null'
            description: Raw Che168 keyword
            title: Q
          description: Raw Che168 keyword
        - name: brand
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 100
              - type: 'null'
            description: Chinese or English make name, ID, or pinyin
            title: Brand
          description: Chinese or English make name, ID, or pinyin
        - name: model
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 100
              - type: 'null'
            description: Chinese or supported English model name/keyword
            title: Model
          description: Chinese or supported English model name/keyword
        - name: price_min
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 0
              - type: 'null'
            description: >-
              Minimum price in currency; CNY must be a multiple of 10,000; EUR
              rounds up to a 10,000-CNY step
            title: Price Min
          description: >-
            Minimum price in currency; CNY must be a multiple of 10,000; EUR
            rounds up to a 10,000-CNY step
        - name: price_max
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 0
              - type: 'null'
            description: >-
              Maximum price in currency; CNY must be a multiple of 10,000; EUR
              rounds down to a 10,000-CNY step
            title: Price Max
          description: >-
            Maximum price in currency; CNY must be a multiple of 10,000; EUR
            rounds down to a 10,000-CNY step
        - name: currency
          in: query
          required: false
          schema:
            enum:
              - cny
              - eur
            type: string
            description: >-
              Currency of price_min/price_max. EUR bounds round inward to
              Che168's 10,000-CNY steps and may exclude cars near the edges.
            default: cny
            title: Currency
          description: >-
            Currency of price_min/price_max. EUR bounds round inward to Che168's
            10,000-CNY steps and may exclude cars near the edges.
        - name: age_min
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 100
                minimum: 0
              - type: 'null'
            description: Minimum vehicle age in years
            title: Age Min
          description: Minimum vehicle age in years
        - name: age_max
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 100
                minimum: 0
              - type: 'null'
            description: Maximum vehicle age in years
            title: Age Max
          description: Maximum vehicle age in years
        - name: mileage_min
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 0
              - type: 'null'
            description: Minimum km; must be a multiple of 10,000
            title: Mileage Min
          description: Minimum km; must be a multiple of 10,000
        - name: mileage_max
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 0
              - type: 'null'
            description: Maximum km; must be a multiple of 10,000
            title: Mileage Max
          description: Maximum km; must be a multiple of 10,000
        - name: fuel_type
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'Comma-separated: gasoline, diesel, hybrid, new_energy'
            title: Fuel Type
          description: 'Comma-separated: gasoline, diesel, hybrid, new_energy'
        - name: transmission
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - manual
                  - automatic
                type: string
              - type: 'null'
            title: Transmission
        - name: body_style
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: One value returned by /v1/filters
            title: Body Style
          description: One value returned by /v1/filters
        - name: sort
          in: query
          required: false
          schema:
            enum:
              - default
              - price_asc
              - price_desc
              - newest
              - youngest
              - mileage_asc
            type: string
            default: default
            title: Sort
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    SearchResponse:
      properties:
        total_count:
          type: integer
          title: Total Count
        page:
          type: integer
          title: Page
        limit:
          type: integer
          title: Limit
        results:
          items:
            $ref: '#/components/schemas/CarListing'
          type: array
          title: Results
        next_page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Next Page
      type: object
      required:
        - total_count
        - page
        - limit
        - results
      title: SearchResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CarListing:
      properties:
        id:
          type: string
          title: Id
        title:
          type: string
          title: Title
        year:
          anyOf:
            - type: integer
            - type: 'null'
          title: Year
        mileage_km:
          anyOf:
            - type: integer
            - type: 'null'
          title: Mileage Km
        price_cny:
          anyOf:
            - type: integer
            - type: 'null'
          title: Price Cny
        price_eur:
          anyOf:
            - type: number
            - type: 'null'
          title: Price Eur
          description: >-
            CNY price converted to EUR, rounded to cents; null if price or
            exchange rate is unavailable
        location:
          anyOf:
            - type: string
            - type: 'null'
          title: Location
        thumbnail:
          anyOf:
            - type: string
            - type: 'null'
          title: Thumbnail
        source_url:
          type: string
          title: Source Url
      type: object
      required:
        - id
        - title
        - source_url
      title: CarListing
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.