Neynar Cast API

Operations related to cast

OpenAPI Specification

neynar-cast-api-openapi.yml Raw ↑
openapi: 3.0.4
info:
  contact:
    email: team@neynar.com
    name: Neynar
    url: https://neynar.com/
  description: The Neynar API allows you to interact with the Farcaster protocol among other things. See the [Neynar docs](https://docs.neynar.com/reference) for more details.
  title: Neynar Action Cast API
  version: 3.176.0
servers:
- url: https://api.neynar.com
security:
- ApiKeyAuth: []
tags:
- description: Operations related to cast
  externalDocs:
    description: More info about cast
    url: https://docs.neynar.com/reference/cast-operations
  name: Cast
paths:
  /v2/farcaster/cast/:
    delete:
      description: "Delete an existing cast. \n(In order to delete a cast `signer_uuid` must be approved)"
      externalDocs:
        url: https://docs.neynar.com/reference/delete-cast
      operationId: delete-cast
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteCastReqBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResponse'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Bad Request
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Resource not found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Server Error
      summary: Delete a cast
      tags:
      - Cast
    get:
      description: Gets information about an individual cast by passing in a Farcaster web URL or cast hash
      externalDocs:
        url: https://docs.neynar.com/reference/lookup-cast-by-hash-or-url
      operationId: lookup-cast-by-hash-or-url
      parameters:
      - $ref: '#/components/parameters/NeynarExperimentalHeader'
      - description: Cast identifier (It's either a URL or a hash)
        in: query
        name: identifier
        required: true
        schema:
          example: https://farcaster.xyz/rish/0xafa59bb7
          type: string
      - description: 'The query param accepted by the API. Sent along with identifier param.

          url - Cast identifier is a url

          hash - Cast identifier is a hash'
        in: query
        name: type
        required: true
        schema:
          enum:
          - url
          - hash
          example: url
          type: string
      - description: adds viewer_context to cast object to show whether viewer has liked or recasted the cast.
        in: query
        name: viewer_fid
        schema:
          minimum: 1
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CastResponse'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Bad Request
      summary: By hash or URL
      tags:
      - Cast
    post:
      description: "Posts a cast or cast reply. Works with mentions and embeds.  \n(In order to post a cast `signer_uuid` must be approved)"
      externalDocs:
        url: https://docs.neynar.com/reference/publish-cast
      operationId: publish-cast
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostCastReqBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostCastResponse'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Bad Request
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Resource not found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Server Error
      summary: Post a cast
      tags:
      - Cast
  /v2/farcaster/cast/conversation/:
    get:
      description: Gets all casts related to a conversation surrounding a cast by passing in a cast hash or Farcaster URL. Includes all the ancestors of a cast up to the root parent in a chronological order. Includes all direct_replies to the cast up to the reply_depth specified in the query parameter.
      externalDocs:
        url: https://docs.neynar.com/reference/lookup-cast-conversation
      operationId: lookup-cast-conversation
      parameters:
      - $ref: '#/components/parameters/NeynarExperimentalHeader'
      - description: Cast identifier (It's either a URL or a hash)
        in: query
        name: identifier
        required: true
        schema:
          example: https://warpcast.com/rish/0x9288c1
          type: string
      - description: 'The query param accepted by the API. Sent along with identifier param.

          url - Cast identifier is a url

          hash - Cast identifier is a hash'
        in: query
        name: type
        required: true
        schema:
          enum:
          - url
          - hash
          example: url
          type: string
      - description: The depth of replies in the conversation that will be returned (default 2)
        in: query
        name: reply_depth
        schema:
          default: 2
          maximum: 5
          minimum: 0
          type: integer
      - description: Include all parent casts in chronological order
        in: query
        name: include_chronological_parent_casts
        schema:
          default: false
          type: boolean
      - description: Providing this will return a conversation that respects this user's mutes and blocks and includes `viewer_context`.
        in: query
        name: viewer_fid
        schema:
          minimum: 1
          type: integer
      - description: Sort type for the ordering of descendants. Default is `chron`
        in: query
        name: sort_type
        schema:
          enum:
          - chron
          - desc_chron
          - algorithmic
          example: chron
          type: string
      - description: Show conversation above or below the fold. Lower quality responses are hidden below the fold. Not passing in a value shows the full conversation without any folding.
        in: query
        name: fold
        schema:
          enum:
          - above
          - below
          type: string
      - description: Number of results to fetch
        in: query
        name: limit
        schema:
          default: 20
          example: 30
          format: int32
          maximum: 50
          minimum: 1
          type: integer
        x-is-limit-param: true
      - description: Pagination cursor.
        in: query
        name: cursor
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conversation'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Bad Request
      summary: Conversation for a cast
      tags:
      - Cast
  /v2/farcaster/cast/embed/crawl/:
    get:
      description: Crawls the given URL and returns metadata useful when embedding the URL in a cast.
      externalDocs:
        url: https://docs.neynar.com/reference/fetch-embedded-url-metadata
      operationId: fetch-embedded-url-metadata
      parameters:
      - description: URL to crawl metadata of
        in: query
        name: url
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CastEmbedCrawlResponse'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Bad Request
      summary: Embedded URL metadata
      tags:
      - Cast
  /v2/farcaster/cast/quotes/:
    get:
      description: Fetch casts that quote a given cast
      externalDocs:
        url: https://docs.neynar.com/reference/fetch-cast-quotes
      operationId: fetch-cast-quotes
      parameters:
      - $ref: '#/components/parameters/NeynarExperimentalHeader'
      - description: Cast identifier (It's either a URL or a hash)
        in: query
        name: identifier
        required: true
        schema:
          example: https://farcaster.xyz/rish/0xafa59bb7
          type: string
      - description: 'The query param accepted by the API. Sent along with identifier param.

          url - Cast identifier is a url

          hash - Cast identifier is a hash'
        in: query
        name: type
        required: true
        schema:
          enum:
          - url
          - hash
          example: url
          type: string
      - in: query
        name: viewer_fid
        schema:
          minimum: 1
          type: integer
      - description: Number of results to fetch
        in: query
        name: limit
        schema:
          default: 25
          example: 30
          format: int32
          maximum: 100
          minimum: 1
          type: integer
        x-is-limit-param: true
      - description: Pagination cursor.
        in: query
        name: cursor
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  casts:
                    items:
                      $ref: '#/components/schemas/Cast'
                    type: array
                  next:
                    $ref: '#/components/schemas/NextCursor'
                required:
                - casts
                - next
                type: object
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Resource not found
      summary: Cast Quotes
      tags:
      - Cast
  /v2/farcaster/cast/search/:
    get:
      description: Search for casts based on a query string, with optional AND filters
      externalDocs:
        url: https://docs.neynar.com/reference/search-casts
      operationId: search-casts
      parameters:
      - $ref: '#/components/parameters/NeynarExperimentalHeader'
      - description: 'Query string to search for casts. Supported operators:


          | Operator  | Description                                                                                              |

          | --------- | -------------------------------------------------------------------------------------------------------- |

          | `+`       | Acts as the AND operator. This is the default operator between terms and can usually be omitted.         |

          | `\|`      | Acts as the OR operator.                                                                                 |

          | `*`       | When used at the end of a term, signifies a prefix query.                                                  |

          | `"`       | Wraps several terms into a phrase (for example, `"star wars"`).                                          |

          | `(`, `)`  | Wrap a clause for precedence (for example, `star + (wars \| trek)`).                                     |

          | `~n`      | When used after a term (for example, `satr~3`), sets `fuzziness`. When used after a phrase, sets `slop`. |

          | `-`       | Negates the term.                                                                                        |

          | `before:` | Search for casts before a specific date. (e.g. `before:2025-04-20` or `before:2025-04-20T23:59:59`)      |

          | `after:`  | Search for casts after a specific date. (e.g. `after:2025-04-20` or `after:2025-04-20T00:00:00`)         |'
        in: query
        name: q
        required: true
        schema:
          example: star (wars | trek) "space battle" after:2024-05-04
          type: string
      - description: 'Choices are:

          - `literal` - Searches for the words in the query string (default)

          - `semantic` - Searches for the meaning of the query string

          - `hybrid` - Combines both literal and semantic results'
        in: query
        name: mode
        schema:
          enum:
          - literal
          - semantic
          - hybrid
          example: literal
          type: string
      - description: 'Choices are:

          - `desc_chron` - All casts sorted by time in a descending order (default)

          - `chron` - All casts sorted by time in ascending order

          - `algorithmic` - Casts sorted by engagement and time'
        in: query
        name: sort_type
        schema:
          enum:
          - desc_chron
          - chron
          - algorithmic
          example: desc_chron
          type: string
      - description: Fid of the user whose casts you want to search
        in: query
        name: author_fid
        schema:
          minimum: 1
          type: integer
      - description: Providing this will return search results that respects this user's mutes and blocks and includes `viewer_context`.
        in: query
        name: viewer_fid
        schema:
          minimum: 1
          type: integer
      - description: Parent URL of the casts you want to search
        in: query
        name: parent_url
        schema:
          type: string
      - description: Channel ID of the casts you want to search
        in: query
        name: channel_id
        schema:
          type: string
      - description: Number of results to fetch
        in: query
        name: limit
        schema:
          default: 25
          example: 25
          format: int32
          maximum: 100
          minimum: 1
          type: integer
        x-is-limit-param: true
      - description: Pagination cursor
        in: query
        name: cursor
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CastsSearchResponse'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Bad Request
      summary: Search for casts
      tags:
      - Cast
  /v2/farcaster/casts/:
    get:
      description: Fetch multiple casts using their respective hashes.
      externalDocs:
        url: https://docs.neynar.com/reference/fetch-bulk-casts
      operationId: fetch-bulk-casts
      parameters:
      - $ref: '#/components/parameters/NeynarExperimentalHeader'
      - description: Hashes of the cast to be retrived (Comma separated, no spaces)
        in: query
        name: casts
        required: true
        schema:
          example: 0xa896906a5e397b4fec247c3ee0e9e4d4990b8004,0x27ff810f7f718afd8c40be236411f017982e0994
          type: string
          x-comma-separated: true
      - description: adds viewer_context to cast object to show whether viewer has liked or recasted the cast.
        in: query
        name: viewer_fid
        schema:
          minimum: 1
          type: integer
      - description: Optional parameter to sort the casts based on different criteria
        in: query
        name: sort_type
        schema:
          enum:
          - trending
          - likes
          - recasts
          - replies
          - recent
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CastsResponse'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Bad Request
      summary: Bulk fetch casts
      tags:
      - Cast
components:
  schemas:
    ChannelUserContext:
      description: Adds context on the viewer's or author's role in the channel.
      properties:
        following:
          description: Indicates if the user is following the channel.
          type: boolean
        role:
          $ref: '#/components/schemas/ChannelMemberRole'
      required:
      - following
      title: ChannelUserContext
      type: object
    CastEmbedded:
      properties:
        app:
          allOf:
          - $ref: '#/components/schemas/UserDehydrated'
          nullable: true
        author:
          $ref: '#/components/schemas/UserDehydrated'
        channel:
          allOf:
          - $ref: '#/components/schemas/ChannelDehydrated'
          nullable: true
        embeds:
          items:
            $ref: '#/components/schemas/EmbedDeep'
          type: array
        hash:
          type: string
        parent_author:
          properties:
            fid:
              allOf:
              - $ref: '#/components/schemas/Fid'
              nullable: true
          required:
          - fid
          type: object
        parent_hash:
          nullable: true
          type: string
        parent_url:
          nullable: true
          type: string
        root_parent_url:
          nullable: true
          type: string
        text:
          type: string
        timestamp:
          format: date-time
          type: string
      required:
      - hash
      - parent_hash
      - parent_url
      - root_parent_url
      - parent_author
      - author
      - text
      - timestamp
      - embeds
      - channel
      title: CastEmbedded
      type: object
    Conversation:
      properties:
        conversation:
          properties:
            cast:
              $ref: '#/components/schemas/CastAndConversations'
            chronological_parent_casts:
              items:
                $ref: '#/components/schemas/Cast'
              type: array
          required:
          - cast
          type: object
        next:
          $ref: '#/components/schemas/NextCursor'
      required:
      - conversation
      title: Conversation
      type: object
    PostCastReqBody:
      properties:
        channel_id:
          description: Channel ID of the channel where the cast is to be posted. e.g. neynar, farcaster, warpcast
          example: neynar
          type: string
        embeds:
          items:
            $ref: '#/components/schemas/PostCastReqBodyEmbeds'
          maxItems: 2
          type: array
        idem:
          $ref: '#/components/schemas/Idem'
        parent:
          $ref: '#/components/schemas/CastParent'
        parent_author_fid:
          $ref: '#/components/schemas/Fid'
        signer_uuid:
          $ref: '#/components/schemas/SignerUUID'
        text:
          type: string
      required:
      - signer_uuid
      title: PostCastReqBody
      type: object
    CastsSearchResponse:
      properties:
        result:
          properties:
            casts:
              items:
                $ref: '#/components/schemas/Cast'
              type: array
            next:
              $ref: '#/components/schemas/NextCursor'
          required:
          - casts
          - next
          type: object
      required:
      - result
      title: CastsSearchResponse
      type: object
    OperationResponse:
      properties:
        message:
          type: string
        success:
          type: boolean
      title: OperationResponse
      type: object
    SignerUUID:
      description: 'UUID of the signer.

        `signer_uuid` is paired with API key, can''t use a `uuid` made with a different API key.'
      example: 19d0c5fd-9b33-4a48-a0e2-bc7b0555baec
      title: SignerUUID
      type: string
    SolAddress:
      description: Solana address
      pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
      title: SolAddress
      type: string
    FrameV1:
      description: Mini app v1 object
      properties:
        buttons:
          items:
            $ref: '#/components/schemas/FrameActionButton'
          type: array
        frames_url:
          description: Launch URL of the mini app
          type: string
        image:
          description: URL of the image
          type: string
        image_aspect_ratio:
          type: string
        input:
          properties:
            text:
              description: Input text for the mini app
              type: string
          type: object
        post_url:
          description: Post URL to take an action on this mini app
          type: string
        state:
          properties:
            serialized:
              description: State for the mini app in a serialized format
              type: string
          type: object
        title:
          type: string
        version:
          description: Version of the mini app, 'next' for v2, 'vNext' for v1
          type: string
      required:
      - version
      - image
      - frames_url
      title: FrameV1
      type: object
    FrameButtonActionType:
      description: The action type of a mini app button. Action types "mint" & "link" are to be handled on the client side only and so they will produce a no/op for POST /farcaster/frame/action.
      enum:
      - post
      - post_redirect
      - tx
      - link
      - mint
      title: FrameButtonActionType
      type: string
    User:
      properties:
        auth_addresses:
          items:
            properties:
              address:
                $ref: '#/components/schemas/EthAddress'
              app:
                $ref: '#/components/schemas/UserDehydrated'
            required:
            - address
            - app
            type: object
          type: array
        custody_address:
          $ref: '#/components/schemas/EthAddress'
        display_name:
          nullable: true
          type: string
        experimental:
          properties:
            deprecation_notice:
              type: string
            neynar_user_score:
              description: Score that represents the probability that the account is not spam.
              format: double
              type: number
          required:
          - neynar_user_score
          type: object
        fid:
          $ref: '#/components/schemas/Fid'
        follower_count:
          description: The number of followers the user has.
          format: int32
          type: integer
        following_count:
          description: The number of users the user is following.
          format: int32
          type: integer
        object:
          enum:
          - user
          type: string
        pfp_url:
          description: The URL of the user's profile picture
          nullable: true
          type: string
        pro:
          properties:
            expires_at:
              format: date-time
              type: string
            status:
              description: The subscription status of the user
              enum:
              - subscribed
              - unsubscribed
              type: string
            subscribed_at:
              format: date-time
              type: string
          required:
          - status
          - subscribed_at
          - expires_at
          type: object
        profile:
          properties:
            banner:
              properties:
                url:
                  description: The URL of the user's banner image
                  format: uri
                  type: string
              type: object
            bio:
              properties:
                mentioned_channels:
                  items:
                    $ref: '#/components/schemas/ChannelDehydrated'
                  type: array
                mentioned_channels_ranges:
                  description: 'Positions within the text (inclusive start, exclusive end) where each mention occurs.

                    Each index within this list corresponds to the same-numbered index in the mentioned_channels list.'
                  items:
                    $ref: '#/components/schemas/TextRange'
                  type: array
                mentioned_profiles:
                  items:
                    $ref: '#/components/schemas/UserDehydrated'
                  type: array
                mentioned_profiles_ranges:
                  description: 'Positions within the text (inclusive start, exclusive end) where each mention occurs.

                    Each index within this list corresponds to the same-numbered index in the mentioned_profiles list.'
                  items:
                    $ref: '#/components/schemas/TextRange'
                  type: array
                text:
                  type: string
              required:
              - text
              type: object
            live_at:
              properties:
                is_live:
                  type: boolean
                updated_at:
                  format: date-time
                  type: string
                url:
                  description: The URL of the user's current live activity
                  type: string
              required:
              - url
              - updated_at
              - is_live
              type: object
            location:
              $ref: '#/components/schemas/Location'
          required:
          - bio
          type: object
        registered_at:
          format: date-time
          type: string
        score:
          description: Score that represents the probability that the account is not spam.
          format: double
          type: number
        username:
          type: string
        verifications:
          items:
            $ref: '#/components/schemas/EthAddress'
          type: array
        verified_accounts:
          items:
            description: Verified accounts of the user on other platforms, currently only X is supported.
            properties:
              platform:
                enum:
                - x
                - github
                type: string
              username:
                type: string
            type: object
          type: array
        verified_addresses:
          properties:
            eth_addresses:
              description: List of verified Ethereum addresses of the user sorted by oldest to most recent.
              items:
                $ref: '#/components/schemas/EthAddress'
              type: array
            primary:
              properties:
                eth_address:
                  allOf:
                  - $ref: '#/components/schemas/EthAddress'
                  nullable: true
                sol_address:
                  allOf:
                  - $ref: '#/components/schemas/SolAddress'
                  nullable: true
              required:
              - eth_address
              - sol_address
              type: object
            sol_addresses:
              description: List of verified Solana addresses of the user sorted by oldest to most recent.
              items:
                $ref: '#/components/schemas/SolAddress'
              type: array
          required:
          - eth_addresses
          - sol_addresses
          - primary
          type: object
        viewer_context:
          $ref: '#/components/schemas/UserViewerContext'
      required:
      - object
      - fid
      - username
      - custody_address
      - registered_at
      - profile
      - follower_count
      - following_count
      - verifications
      - auth_addresses
      - verified_addresses
      - verified_accounts
      title: User
      type: object
    Embed:
      anyOf:
      - $ref: '#/components/schemas/EmbedCast'
      - $ref: '#/components/schemas/EmbedUrl'
      title: Embed
    ChannelMemberRole:
      description: The role of a channel member
      enum:
      - member
      - moderator
      - owner
      title: ChannelMemberRole
      type: string
    OembedVideoData:
      description: Video OEmbed data
      properties:
        author_name:
          description: The name of the author/owner of the resource.
          nullable: true
          type: string
        author_url:
          description: A URL for the author/owner of the resource.
          nullable: true
          type: string
        cache_age:
          description: The suggested cache lifetime for this resource, in seconds. Consumers may choose to use this value or not.
          nullable: true
          type: string
        height:
          description: The height in pixels required to display the HTML.
          nullable: true
          type: number
        html:
          description: The HTML required to embed a video player. The HTML should have no padding or margins. Consumers may wish to load the HTML in an off-domain iframe to avoid XSS vulnerabilities.
          nullable: true
          type: string
        provider_name:
          description: The name of the resource provider.
          nullable: true
          type: string
        provider_url:
          description: The url of the resource provider.
          nullable: true
          type: string
        thumbnail_height:
          description: The height of the optional thumbnail. If this parameter is present, thumbnail_url and thumbnail_width must also be present.
          nullable: true
          type: number
        thumbnail_url:
          description: A URL to a thumbnail image representing the resource. The thumbnail must respect any maxwidth and maxheight parameters. If this parameter is present, thumbnail_width and thumbnail_height must also be present.
          nullable: true
          type: string
        thumbnail_width:
          description: The width of the optional thumbnail. If this parameter is present, thumbnail_url and thumbnail_height must also be present.
          nullable: true
          type: number
        title:
          description: A text title, describing the resource.
          nullable: true
          type: string
        type:
          enum:
          - video
          type: string
        version:
          nullable: true
          type: string
        width:
          description: The width in pixels required to display the HTML.
          nullable: true
          type: number
      required:
      - type
      - version
      - html
      title: OembedVideoData
      type: object
    UserViewerContext:
      description: Adds context on the viewer's follow relationship with the user.
      properties:
        blocked_by:
          description: Indicates if the viewer is blocked by the user.
          type: boolean
        blocking:
          description: Indicates if the viewer is blocking the user.
          type: boolean
        followed_by:
          description: Indicates if the viewer is followed by the user.
          type: boolean
        following:
          description: Indicates if the viewer is following the user.
          type: boolean
      required:
      - following
      - followed_by
      - blocking
      - blocked_by
      title: UserViewerContext
      type: object
    EmbedUrl:
      properties:
        metadata:
          $ref: '#/components/schemas/EmbedUrlMetadata'
        url:
          type: string
      required:
      - url
      title: EmbedUrl
      type: object
    CastDehydrated:
      properties:
        app:
          allOf:
          - $ref: '#/components/schemas/UserDehydrated'
          nullable: true
        author:
          $r

# --- truncated at 32 KB (71 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/api-evangelist-neynar/refs/heads/main/openapi/neynar-cast-api-openapi.yml