Airstack Usernames API

The Usernames API from Airstack — 2 operation(s) for usernames.

OpenAPI Specification

airstack-usernames-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Farcaster Hub REST Casts Usernames API
  version: '1.0'
  description: "Perform basic queries of Farcaster state via the REST API of a Farcaster hub. See the [Farcaster docs](https://www.thehubble.xyz/docs/httpapi/httpapi.html) for more details. Some client libraries:\n  - [TypeScript](https://www.npmjs.com/package/@standard-crypto/farcaster-js-hub-rest)\n"
servers:
- url: https://hubs.airstack.xyz
security:
- ApiKeyAuth: []
tags:
- name: Usernames
paths:
  /v1/userNameProofsByFid:
    get:
      security:
      - ApiKeyAuth: []
      tags:
      - Usernames
      operationId: ListUsernameProofsByFid
      summary: Get a list of proofs provided by an FID
      parameters:
      - name: fid
        in: query
        schema:
          type: integer
        required: true
        description: The FID being requested
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsernameProofsResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v1/userNameProofByName:
    get:
      security:
      - ApiKeyAuth: []
      tags:
      - Usernames
      summary: Get an proof for a username by the Farcaster username
      operationId: GetUsernameProof
      parameters:
      - name: name
        in: query
        schema:
          type: string
        required: true
        description: The Farcaster username or ENS address
        examples:
          username:
            value: gavi
          ENS address:
            value: dwr.eth
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserNameProof'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    UsernameProofsResponse:
      type: object
      properties:
        proofs:
          type: array
          items:
            $ref: '#/components/schemas/UserNameProof'
      required:
      - proofs
    UserNameType:
      type: string
      default: USERNAME_TYPE_FNAME
      enum:
      - USERNAME_TYPE_FNAME
      - USERNAME_TYPE_ENS_L1
    UserNameProof:
      type: object
      properties:
        timestamp:
          type: integer
          format: uint64
        name:
          type: string
          example: gavi
        owner:
          pattern: ^0x[0-9a-fA-F]{40}$
          type: string
        signature:
          pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
          type: string
          format: byte
        fid:
          type: integer
          format: uint64
        type:
          $ref: '#/components/schemas/UserNameType'
      required:
      - timestamp
      - name
      - owner
      - signature
      - fid
      - type
    ErrorResponse:
      required:
      - code
      - details
      - errCode
      - metadata
      - name
      - presentable
      type: object
      properties:
        errCode:
          type: string
        presentable:
          type: boolean
        name:
          type: string
        code:
          type: integer
        details:
          type: string
        metadata:
          required:
          - errcode
          type: object
          properties:
            errcode:
              type: array
              items:
                type: string
  responses:
    ErrorResponse:
      description: An unexpected error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-airstack-hubs