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

# Read retained ZIP market statistics

> Read this account’s unexpired RentCast ZIP-level sale/rental listing statistics saved by searchMarkets for24 hours; no fresh provider request. 1 credit; errors/replay0. Provider aggregates from listing observations — not transaction records, appraisals or coverage-complete market measures; history gaps reflect low listing volume.

Read this account’s unexpired RentCast ZIP-level market statistics for1 credit. Requires an `mkt_rentcast_` market\_id saved by a successful RentCast `searchMarkets`;24h retention. Returns retained sale and rental aggregates — average/median/min/max prices, per-square-foot metrics, days on market, listing counts and per-property-type breakdowns plus the source-published monthly history. No fresh provider call; expired or cross-account IDs return404. These are listing-derived aggregates — not transactions, appraisals or coverage-complete market measures; history gaps reflect low listing volume.


## OpenAPI

````yaml GET /v1/markets/{market_id}/stats
openapi: 3.1.0
info:
  title: RealtyCrawl API
  version: 0.1.0
  description: >-
    Unified real estate API with source-specific operations, markets and access
    requirements. Check current capabilities before source requests.
    Documentation-backed beta contracts require explicit configuration and do
    not establish fresh live source acceptance.
servers: []
security:
  - ApiKeyAuth: []
paths:
  /v1/markets/{market_id}/stats:
    get:
      tags:
        - markets
      summary: Read retained ZIP market statistics
      description: >-
        Read this account’s unexpired RentCast ZIP-level sale/rental listing
        statistics saved by searchMarkets for24 hours; no fresh provider
        request. 1 credit; errors/replay0. Provider aggregates from listing
        observations — not transaction records, appraisals or coverage-complete
        market measures; history gaps reflect low listing volume.
      operationId: getMarketStatistics
      parameters:
        - name: market_id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
        - name: fields
          in: query
          description: >-
            Response-only comma-separated field paths relative to data items; up
            to 32 paths. Source requests and billing are unchanged.
          schema:
            type: string
            maxLength: 4127
        - name: format
          in: query
          description: >-
            Response-only export format. JSON retains the envelope; CSV/NDJSON
            contain data records, with request/credit metadata in headers.
            Errors stay JSON.
          schema:
            type: string
            enum:
              - json
              - csv
              - ndjson
            default: json
      responses:
        '200':
          description: Successful response; meta discloses source completeness
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getMarketStatisticsResponse'
            text/csv:
              schema:
                type: string
                description: Data rows only; request, row count and credits are in headers.
            application/x-ndjson:
              schema:
                type: string
                description: One JSON data item per line; metadata is in headers.
        default:
          description: Typed error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    getMarketStatisticsResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/MarketStatistics'
        meta:
          $ref: '#/components/schemas/Meta'
      required:
        - data
        - meta
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            details:
              type: array
              items:
                $ref: '#/components/schemas/SourceOutcome'
          required:
            - code
            - message
            - retryable
          additionalProperties: false
        request_id:
          type: string
      required:
        - error
        - request_id
      additionalProperties: false
    MarketStatistics:
      type: object
      properties:
        id:
          type: string
        zip_code:
          type: string
        sale:
          anyOf:
            - type: object
              properties:
                average_price:
                  anyOf:
                    - type: string
                    - type: 'null'
                median_price:
                  anyOf:
                    - type: string
                    - type: 'null'
                min_price:
                  anyOf:
                    - type: string
                    - type: 'null'
                max_price:
                  anyOf:
                    - type: string
                    - type: 'null'
                average_price_per_sqft:
                  anyOf:
                    - type: number
                    - type: 'null'
                average_sqft:
                  anyOf:
                    - type: number
                    - type: 'null'
                average_days_on_market:
                  anyOf:
                    - type: number
                    - type: 'null'
                new_listings:
                  anyOf:
                    - type: number
                    - type: 'null'
                total_listings:
                  anyOf:
                    - type: number
                    - type: 'null'
                last_updated:
                  anyOf:
                    - type: string
                      format: date
                    - type: 'null'
                by_property_type:
                  type: array
                  items:
                    type: object
                    properties:
                      property_type:
                        anyOf:
                          - type: string
                          - type: 'null'
                      average_price:
                        anyOf:
                          - type: string
                          - type: 'null'
                      median_price:
                        anyOf:
                          - type: string
                          - type: 'null'
                      total_listings:
                        anyOf:
                          - type: number
                          - type: 'null'
                    required:
                      - property_type
                      - average_price
                      - median_price
                      - total_listings
                    additionalProperties: false
                history:
                  type: array
                  items:
                    type: object
                    properties:
                      month:
                        type: string
                      average_price:
                        anyOf:
                          - type: string
                          - type: 'null'
                      median_price:
                        anyOf:
                          - type: string
                          - type: 'null'
                      new_listings:
                        anyOf:
                          - type: number
                          - type: 'null'
                      total_listings:
                        anyOf:
                          - type: number
                          - type: 'null'
                      average_days_on_market:
                        anyOf:
                          - type: number
                          - type: 'null'
                    required:
                      - month
                      - average_price
                      - median_price
                      - new_listings
                      - total_listings
                      - average_days_on_market
                    additionalProperties: false
              required:
                - average_price
                - median_price
                - min_price
                - max_price
                - average_price_per_sqft
                - average_sqft
                - average_days_on_market
                - new_listings
                - total_listings
                - last_updated
                - by_property_type
                - history
              additionalProperties: false
            - type: 'null'
        rental:
          anyOf:
            - type: object
              properties:
                average_price:
                  anyOf:
                    - type: string
                    - type: 'null'
                median_price:
                  anyOf:
                    - type: string
                    - type: 'null'
                min_price:
                  anyOf:
                    - type: string
                    - type: 'null'
                max_price:
                  anyOf:
                    - type: string
                    - type: 'null'
                average_price_per_sqft:
                  anyOf:
                    - type: number
                    - type: 'null'
                average_sqft:
                  anyOf:
                    - type: number
                    - type: 'null'
                average_days_on_market:
                  anyOf:
                    - type: number
                    - type: 'null'
                new_listings:
                  anyOf:
                    - type: number
                    - type: 'null'
                total_listings:
                  anyOf:
                    - type: number
                    - type: 'null'
                last_updated:
                  anyOf:
                    - type: string
                      format: date
                    - type: 'null'
                by_property_type:
                  type: array
                  items:
                    type: object
                    properties:
                      property_type:
                        anyOf:
                          - type: string
                          - type: 'null'
                      average_price:
                        anyOf:
                          - type: string
                          - type: 'null'
                      median_price:
                        anyOf:
                          - type: string
                          - type: 'null'
                      total_listings:
                        anyOf:
                          - type: number
                          - type: 'null'
                    required:
                      - property_type
                      - average_price
                      - median_price
                      - total_listings
                    additionalProperties: false
                history:
                  type: array
                  items:
                    type: object
                    properties:
                      month:
                        type: string
                      average_price:
                        anyOf:
                          - type: string
                          - type: 'null'
                      median_price:
                        anyOf:
                          - type: string
                          - type: 'null'
                      new_listings:
                        anyOf:
                          - type: number
                          - type: 'null'
                      total_listings:
                        anyOf:
                          - type: number
                          - type: 'null'
                      average_days_on_market:
                        anyOf:
                          - type: number
                          - type: 'null'
                    required:
                      - month
                      - average_price
                      - median_price
                      - new_listings
                      - total_listings
                      - average_days_on_market
                    additionalProperties: false
              required:
                - average_price
                - median_price
                - min_price
                - max_price
                - average_price_per_sqft
                - average_sqft
                - average_days_on_market
                - new_listings
                - total_listings
                - last_updated
                - by_property_type
                - history
              additionalProperties: false
            - type: 'null'
        history_note:
          type: string
        source:
          $ref: '#/components/schemas/Source'
      required:
        - id
        - zip_code
        - sale
        - rental
        - history_note
        - source
      additionalProperties: false
    Meta:
      type: object
      properties:
        request_id:
          type: string
        schema_version:
          type: string
        generated_at:
          type: string
          format: date-time
        completeness:
          type: string
          enum:
            - complete
            - partial
            - unknown
        sources:
          type: array
          items:
            $ref: '#/components/schemas/SourceOutcome'
        warnings:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              message:
                type: string
              field:
                type: string
            required:
              - code
              - message
            additionalProperties: false
        pagination:
          type: object
          properties:
            next_cursor:
              anyOf:
                - type: string
                - type: 'null'
            has_more:
              type: boolean
            returned:
              type: integer
            total:
              anyOf:
                - type: integer
                - type: 'null'
            total_relation:
              type: string
              enum:
                - exact
                - lower_bound
                - unknown
          required:
            - next_cursor
            - has_more
            - returned
            - total
            - total_relation
          additionalProperties: false
        property_groups:
          type: array
          items:
            $ref: '#/components/schemas/PropertyGroup'
      required:
        - request_id
        - schema_version
        - generated_at
        - completeness
        - sources
      additionalProperties: false
    SourceOutcome:
      type: object
      properties:
        platform:
          type: string
        provider:
          anyOf:
            - type: string
            - type: 'null'
        status:
          type: string
          enum:
            - success
            - partial
            - failed
            - unsupported
        error_code:
          anyOf:
            - type: string
            - type: 'null'
        truncated:
          type: boolean
        observed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
      required:
        - platform
        - status
      additionalProperties: false
    Source:
      type: object
      properties:
        platform:
          type: string
        country:
          type: string
        native_id:
          anyOf:
            - type: string
            - type: 'null'
        url:
          anyOf:
            - type: string
              format: uri
            - type: 'null'
        provider:
          type: string
        observed_at:
          type: string
          format: date-time
        source_updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        access_class:
          type: string
          enum:
            - public_portal
            - licensed_feed
            - public_record
            - modeled
        retrieved_at:
          type: string
          format: date-time
      required:
        - platform
        - provider
        - observed_at
        - access_class
      additionalProperties: false
    PropertyGroup:
      type: object
      properties:
        property_id:
          anyOf:
            - type: string
            - type: 'null'
        listing_ids:
          type: array
          items:
            type: string
        match_method:
          type: string
        confidence:
          anyOf:
            - type: number
            - type: 'null'
        status:
          type: string
          enum:
            - matched
            - ambiguous
      required:
        - property_id
        - listing_ids
        - match_method
        - status
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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