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

# Get the latest available period



## OpenAPI

````yaml /api-reference/openapi.json get /v1/periods/latest
openapi: 3.0.0
info:
  title: Amazonomics API
  version: 0.0.1
  description: The Amazonomics REST API. All endpoints need an API key.
servers:
  - url: https://api.amazonomics.com
security:
  - bearerAuth: []
paths:
  /v1/periods/latest:
    get:
      tags:
        - Metadata
      summary: Get the latest available period
      parameters:
        - schema:
            $ref: '#/components/schemas/PeriodType'
          required: false
          name: type
          in: query
        - schema:
            $ref: '#/components/schemas/PeriodScope'
          required: false
          name: scope
          in: query
      responses:
        '200':
          description: Latest period retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LatestPeriodResponse'
        '404':
          description: No periods found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LatestPeriodResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LatestPeriodResponse'
components:
  schemas:
    PeriodType:
      type: string
      enum:
        - D
        - M
        - W
      default: M
    PeriodScope:
      type: string
      enum:
        - data
        - trends
      default: data
    LatestPeriodResponse:
      type: object
      properties:
        period:
          type: string
          nullable: true
        error:
          type: object
          nullable: true
          properties:
            code:
              type: string
            message:
              type: string
            hint:
              type: string
            docs:
              type: string
          required:
            - code
            - message
      required:
        - period
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````