> ## 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.

# Count matching listings

> Count listings using the same supported filters as search.

## Behavior

The response contains `count`. There is no `page` or `lang` parameter. CNY/EUR price bounds have the same interpretation and source-step rounding as search. A count call consumes its own 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/count?brand=BMW&currency=cny&price_max=200000" \
  -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"}
{
  "count": 120
}
```

Read the [integration guide](/currencies-and-prices) 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/count
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/count:
    get:
      tags:
        - Search
      summary: Count Che168 used-car listings
      operationId: count_cars_v1_search_count_get
      parameters:
        - 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/CountResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    CountResponse:
      properties:
        count:
          type: integer
          title: Count
      type: object
      required:
        - count
      title: CountResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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.