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

# List supported candle timeframes

> The timeframe ids accepted by the candle, footprint, TPO, and stream endpoints, plus the
count rules that define which further ids are valid (for example `3m` or `2h`).
Canonical suffixes include `M` for months and `Q` for quarters.

**Cost:** 1000 credits per request (flat).




## OpenAPI

````yaml /platform-api/specs/openapi.yaml get /api/v1/marketdata/timeframes
openapi: 3.0.3
info:
  title: TakeProfit API (REST)
  version: 0.6.0
  contact:
    email: support@takeprofit.com
  description: |
    Historical marketdata and the security catalog over REST. Live streams
    (candles, volume footprint, order books) are served over WebSocket and
    described by the AsyncAPI document at
    `https://public-api.takeprofit.com/api/v1/marketdata/asyncapi.yaml`.
    Guides (getting an API key, credits and quota, errors) live at
    [takeprofit.com/docs](https://takeprofit.com/docs).

    ## Requests

    - Base URL: `https://public-api.takeprofit.com`.
    - Every endpoint answers `GET` only.
    - Authenticate with the `x-api-key` header; exactly one header value is
      required.
    - Unknown query parameters and repeated scalar parameters are rejected
      with 400.
    - Identify securities with `exchange` and `symbol` as returned by the
      catalog endpoints; internal ids and GUIDs are not accepted (search
      additionally accepts an ISIN as a lookup key).

    ## Credits and quota

    Requests are metered in credits against a fixed quota window of 100000
    credits per 60 seconds, shared by all API keys of the account. Each
    operation states its price; every billed request costs at least 1000
    credits, so an account makes at most 100 requests per minute. Every
    authenticated response carries the window state:

    - `X-RateLimit-Limit` - credits per window;
    - `X-RateLimit-Remaining` - credits still available after this request;
    - `X-RateLimit-Reset` - epoch second the window resets at.

    A request the remaining credits cannot cover is rejected with 429 and
    `Retry-After` (seconds until the window resets); the rejection itself is
    free.

    ## Errors

    Every error response is `{"error": {"code": "<stable code>", "message":
    "<human-readable text>"}}`. The statuses listed on each operation (400,
    401, 403, 404, 429) are the outcomes a client handles explicitly. A 400
    is either `invalid_argument` (a malformed request) or `too_much_data`: the
    request produces more data than can be served in one response, and only a
    narrower window fixes it - it is never a rate limit. In
    addition, any operation can answer 502 (`bad_gateway`), 503
    (`unavailable`) or 504 (`deadline_exceeded`) while the gateway or an
    upstream is unavailable or slow; these are transient - retry with
    exponential backoff.
servers:
  - url: https://public-api.takeprofit.com
    description: Production
security: []
paths:
  /api/v1/marketdata/timeframes:
    get:
      tags:
        - Candles
      summary: List supported candle timeframes
      description: >
        The timeframe ids accepted by the candle, footprint, TPO, and stream
        endpoints, plus the

        count rules that define which further ids are valid (for example `3m` or
        `2h`).

        Canonical suffixes include `M` for months and `Q` for quarters.


        **Cost:** 1000 credits per request (flat).
      operationId: listTimeframes
      responses:
        '200':
          description: Timeframe list.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeframesResponse'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - ApiKeyAuth: []
components:
  headers:
    RateLimitLimit:
      description: Credits allowed per quota window.
      schema:
        type: integer
    RateLimitRemaining:
      description: Credits still available in the current quota window after this request.
      schema:
        type: integer
    RateLimitReset:
      description: Epoch second at which the current quota window resets.
      schema:
        type: integer
        format: int64
    RetryAfter:
      description: Seconds until the quota window resets and the request can be retried.
      schema:
        type: integer
  schemas:
    TimeframesResponse:
      type: object
      required:
        - timeframes
        - countRules
      properties:
        timeframes:
          type: array
          items:
            $ref: '#/components/schemas/Timeframe'
        countRules:
          type: array
          description: >-
            Which counts each unit accepts: any id made of a count within one of
            the unit's ranges (stepping by step) followed by its suffix is a
            valid timeframe, for example 3m, 2h, or 6M.
          items:
            $ref: '#/components/schemas/TimeframeCountRule'
      example:
        timeframes:
          - id: 1m
            unit: MINUTE
            count: 1
            label: 1 minute
          - id: 1h
            unit: HOUR
            count: 1
            label: 1 hour
          - id: 1d
            unit: DAY
            count: 1
            label: 1 day
          - id: 1M
            unit: MONTH
            count: 1
            label: 1 month
        countRules:
          - unit: MINUTE
            suffix: m
            ranges:
              - from: 1
                to: 1440
                step: 1
          - unit: MONTH
            suffix: M
            ranges:
              - from: 1
                to: 12
                step: 1
    Timeframe:
      type: object
      required:
        - id
        - unit
        - count
      properties:
        id:
          $ref: '#/components/schemas/TimeframeId'
        unit:
          type: string
        count:
          type: integer
          minimum: 1
        label:
          type: string
    TimeframeCountRule:
      type: object
      required:
        - unit
        - suffix
        - ranges
      properties:
        unit:
          type: string
        suffix:
          type: string
        ranges:
          type: array
          items:
            $ref: '#/components/schemas/CountRange'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable public error code.
            message:
              type: string
              description: Human-readable public error message.
      example:
        error:
          code: unauthenticated
          message: authentication failed
    TimeframeId:
      type: string
      description: >-
        Timeframe id returned by /api/v1/marketdata/timeframes. Canonical
        suffixes include M for months and Q for quarters.
      example: 1h
    CountRange:
      type: object
      required:
        - from
        - to
        - step
      properties:
        from:
          type: integer
          minimum: 1
        to:
          type: integer
          minimum: 1
        step:
          type: integer
          minimum: 1
  responses:
    InvalidRequest:
      description: >-
        Invalid request (`invalid_argument`), or a request producing more data
        than can be served (`too_much_data`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: invalid_argument
              message: query parameter "exchange" is required
    Unauthorized:
      description: Authentication failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: unauthenticated
              message: authentication failed
    Forbidden:
      description: Permission denied.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: permission_denied
              message: permission denied
    RateLimited:
      description: >-
        The remaining credits of the quota window cannot cover this request;
        retry after the window resets.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: rate_limited
              message: rate limit exceeded
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````