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

# Historical Pricing

> Get historical US agency bond end of day pricing data for a given ISIN.



## OpenAPI

````yaml post /api/v1/agency_pricing_history
openapi: 3.0.0
info:
  title: Terrapin API
  version: 1.0.0
servers:
  - url: https://terrapinfinance.com
    variables: {}
security:
  - authorization: []
tags: []
paths:
  /api/v1/agency_pricing_history:
    post:
      tags: []
      summary: US agency historical end of day pricing data
      description: Get historical US agency bond end of day pricing data for a given ISIN.
      operationId: post_agency_pricing_history
      parameters: []
      requestBody:
        content:
          application/json:
            example:
              end_date: '2026-02-15'
              isin: US3135G05Q27
              start_date: '2026-02-10'
            schema:
              additionalProperties: false
              properties:
                end_date:
                  description: Maximum trade date in ISO-8601 format (YYYY-MM-DD).
                  format: date
                  type: string
                  x-check: end_date_gte_start_date
                  x-check-error: end_date must be greater than or equal to start_date
                  x-struct: null
                  x-validate: null
                isin:
                  description: >-
                    International Securities Identification Number (ISIN),
                    unique 12-character code for the security.
                  maxLength: 12
                  minLength: 12
                  nullable: false
                  type: string
                  x-check: valid_check_digit
                  x-check-error: Invalid ISIN check digit
                  x-struct: null
                  x-transform: upcase
                  x-validate: null
                start_date:
                  description: Minimum trade date in ISO-8601 format (YYYY-MM-DD).
                  format: date
                  type: string
                  x-struct: null
                  x-validate: null
              required:
                - end_date
                - isin
                - start_date
              type: object
              x-struct: null
              x-validate: null
        required: true
      responses:
        '200':
          content:
            application/json:
              example:
                data:
                  - convexity: 1.05715
                    date: '2026-02-12'
                    duration: 4.39255
                    estimated_volume: 190000
                    id: npEPlBntFyLppliUHA69rw
                    isin: US3135G05Q27
                    modified_duration: 4.23351
                    price: 88.3626
                    yield_to_maturity: 3.75681
                  - convexity: 1.09098
                    date: '2026-02-13'
                    duration: 4.38999
                    estimated_volume: 75000
                    id: ZUdyW40758Wv6pxAm2r70A
                    isin: US3135G05Q27
                    modified_duration: 4.23417
                    price: 88.657
                    yield_to_maturity: 3.67997
                total: 2
              schema:
                additionalProperties: false
                properties:
                  data:
                    description: List of response data objects, often capped to 1000.
                    items:
                      additionalProperties: false
                      properties:
                        convexity:
                          description: >-
                            Macaulay convexity, as calculated on `date` at
                            `price`.
                          nullable: true
                          type: number
                          x-struct: null
                          x-validate: null
                        date:
                          description: Trade date in ISO-8601 format (YYYY-MM-DD).
                          format: date
                          nullable: false
                          type: string
                          x-struct: null
                          x-validate: null
                        duration:
                          description: >-
                            Macaulay duration, as calculated on `date` at
                            `price`.
                          nullable: true
                          type: number
                          x-struct: null
                          x-validate: null
                        estimated_volume:
                          description: >-
                            Estimated notional traded volume of the bond at
                            `date`. This value will necessarily be an
                            underestimation of the actual traded volume due to
                            the lack of complete reported trades.
                          nullable: true
                          type: number
                          x-struct: null
                          x-validate: null
                        id:
                          description: Unique trade identifier.
                          nullable: false
                          type: string
                          x-struct: null
                          x-validate: null
                        isin:
                          description: >-
                            International Securities Identification Number
                            (ISIN), unique 12-character code for the security.
                          example: CH0282526133
                          maxLength: 12
                          minLength: 12
                          nullable: false
                          type: string
                          x-check: valid_check_digit
                          x-check-error: Invalid ISIN check digit
                          x-struct: null
                          x-transform: upcase
                          x-validate: null
                        modified_duration:
                          description: >-
                            Modified duration, as calculated on `date` at
                            `price`.
                          nullable: true
                          type: number
                          x-struct: null
                          x-validate: null
                        price:
                          description: >
                            Price of the bond at last trade of the day,
                            expressed as a percentage of the bond's face value.
                          nullable: false
                          type: number
                          x-struct: null
                          x-validate: null
                        yield_to_maturity:
                          description: >-
                            Yield to maturity, as calculated on `date` at
                            `price`.
                          nullable: true
                          type: number
                          x-struct: null
                          x-validate: null
                      required:
                        - convexity
                        - date
                        - duration
                        - estimated_volume
                        - id
                        - isin
                        - modified_duration
                        - price
                        - yield_to_maturity
                      type: object
                      x-struct: null
                      x-validate: null
                    type: array
                    x-struct: null
                    x-validate: null
                  total:
                    description: >-
                      Total number of results in the database that match the
                      query filters.
                    type: integer
                    x-struct: null
                    x-validate: null
                required:
                  - data
                  - total
                title: AgencyPricingHistoryResponse
                type: object
                x-struct: null
                x-validate: null
          description: Historical end of day pricing data
        '401':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  errors:
                    items:
                      additionalProperties: false
                      properties:
                        detail:
                          example: Unauthorized
                          type: string
                          x-struct: null
                          x-validate: null
                        reason:
                          example: >-
                            Your account tier does not allow this operation.
                            Contact team@terrapinfinance.com for an upgrade.
                          type: string
                          x-struct: null
                          x-validate: null
                      required:
                        - detail
                      type: object
                      x-struct: null
                      x-validate: null
                    type: array
                    x-struct: null
                    x-validate: null
                required:
                  - errors
                type: object
                x-struct: null
                x-validate: null
          description: Unauthorized
        '402':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  errors:
                    items:
                      additionalProperties: false
                      properties:
                        detail:
                          example: Payment Required
                          type: string
                          x-struct: null
                          x-validate: null
                        reason:
                          example: >-
                            You have run out of your granted quota for this
                            resource as defined by your account tier. Contact
                            team@terrapinfinance.com for an upgrade.
                          type: string
                          x-struct: null
                          x-validate: null
                      required:
                        - detail
                      type: object
                      x-struct: null
                      x-validate: null
                    type: array
                    x-struct: null
                    x-validate: null
                required:
                  - errors
                type: object
                x-struct: null
                x-validate: null
          description: Payment Required
        '403':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  errors:
                    items:
                      additionalProperties: false
                      properties:
                        detail:
                          example: Forbidden
                          type: string
                          x-struct: null
                          x-validate: null
                        reason:
                          example: >-
                            Your account tier does not allow this operation.
                            Contact team@terrapinfinance.com for an upgrade.
                          type: string
                          x-struct: null
                          x-validate: null
                      required:
                        - detail
                      type: object
                      x-struct: null
                      x-validate: null
                    type: array
                    x-struct: null
                    x-validate: null
                required:
                  - errors
                type: object
                x-struct: null
                x-validate: null
          description: Forbidden
        '422':
          content:
            application/json:
              schema:
                properties:
                  errors:
                    items:
                      properties:
                        detail:
                          example: 'Invalid string. Got: integer'
                          type: string
                          x-struct: null
                          x-validate: null
                        source:
                          properties:
                            pointer:
                              example: /isins/0
                              type: string
                              x-struct: null
                              x-validate: null
                          required:
                            - pointer
                          type: object
                          x-struct: null
                          x-validate: null
                        title:
                          example: Invalid value
                          type: string
                          x-struct: null
                          x-validate: null
                      required:
                        - detail
                        - source
                        - title
                      type: object
                      x-struct: null
                      x-validate: null
                    type: array
                    x-struct: null
                    x-validate: null
                required:
                  - errors
                type: object
                x-struct: null
                x-validate: null
          description: Unprocessable Entity
        '429':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  errors:
                    items:
                      additionalProperties: false
                      properties:
                        detail:
                          example: Too Many Requests
                          type: string
                          x-struct: null
                          x-validate: null
                        reason:
                          type: string
                          x-struct: null
                          x-validate: null
                      required:
                        - detail
                      type: object
                      x-struct: null
                      x-validate: null
                    type: array
                    x-struct: null
                    x-validate: null
                required:
                  - errors
                type: object
                x-struct: null
                x-validate: null
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  errors:
                    items:
                      additionalProperties: false
                      properties:
                        detail:
                          example: Internal Server Error
                          type: string
                          x-struct: null
                          x-validate: null
                        reason:
                          type: string
                          x-struct: null
                          x-validate: null
                      required:
                        - detail
                      type: object
                      x-struct: null
                      x-validate: null
                    type: array
                    x-struct: null
                    x-validate: null
                required:
                  - errors
                type: object
                x-struct: null
                x-validate: null
          description: Internal Server Error
      callbacks: {}
components:
  securitySchemes:
    authorization:
      scheme: bearer
      type: http

````