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

# Lista de estados

> Os estados dos EUA que payload.state aceita, como códigos de duas letras com o nome.

`payload.state` recebe o `code` de um destes estados. A lista traz os 50 estados dos EUA e `DC`; qualquer outro `country` devolve um array vazio. Veja [Regiões e localização](https://docs.querying.ai/pt/engines/capacity.md) para os mecanismos que aceitam `state` e o que ele soma ao preço de uma tarefa.

O endpoint não precisa de chave de API. A lista muda pouco, então busque-a na inicialização e guarde em cache. A resposta é um array puro, como no Cloro, e traz `Cache-Control: public, max-age=3600`.


## OpenAPI

````yaml GET /v1/states
openapi: 3.1.0
info:
  title: querying.ai
  description: >-
    One API for every AI answer engine. Every task is asynchronous: submit, then
    collect the result via webhook or polling.
  version: 1.0.0
servers:
  - url: https://api.querying.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/states:
    get:
      tags:
        - Operations
      summary: List of states
      description: >-
        The US states payload.state accepts. Only US returns states; any other
        country returns an empty array. No API key needed. Read it at start-up
        and cache it: the list changes rarely.
      operationId: getStates
      parameters:
        - name: country
          in: query
          required: true
          description: >-
            ISO 3166-1 alpha-2 country code, case-insensitive. Only `US` returns
            states.
          schema:
            type: string
            minLength: 2
            maxLength: 2
            pattern: ^[A-Za-z]{2}$
          example: US
      responses:
        '200':
          description: The states, in alphabetical order of name.
          headers:
            Cache-Control:
              schema:
                type: string
                example: public, max-age=3600
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  required:
                    - code
                    - name
                  properties:
                    code:
                      type: string
                      description: USPS two-letter code, the value payload.state takes.
                      example: CA
                    name:
                      type: string
                      example: California
              example:
                - code: AL
                  name: Alabama
                - code: AK
                  name: Alaska
                - code: AZ
                  name: Arizona
        '400':
          description: '`country` is missing or is not a two-letter code.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security: []
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ErrorDetail'
    ErrorDetail:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable, safe to branch on. See the Errors guide for the full list.
        message:
          type: string
          description: For humans. May change.
        details:
          description: >-
            Context for the error. An array of `{field, message}` on most
            `VALIDATION_ERROR`s; an object elsewhere (for example `{id}` on
            `RESOURCE_NOT_FOUND`, `retryAfterSec` on 429 and 503 codes). Omitted
            when there is nothing to add.
          oneOf:
            - type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
            - type: object
              additionalProperties: true
        timestamp:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key, sent as `Authorization: Bearer <key>`.'

````

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