@neynar/nodejs-sdk
Version:
SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)
905 lines • 57.8 kB
TypeScript
/**
* Neynar API
* 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.
*
* The version of the OpenAPI document: 3.115.0
* Contact: team@neynar.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import { type RequestArgs, BaseAPI } from '../base';
import type { CastEmbedCrawlResponse } from '../models';
import type { CastResponse } from '../models';
import type { CastsResponse } from '../models';
import type { CastsSearchResponse } from '../models';
import type { Conversation } from '../models';
import type { DeleteCastReqBody } from '../models';
import type { FetchCastQuotes200Response } from '../models';
import type { OperationResponse } from '../models';
import type { PostCastReqBody } from '../models';
import type { PostCastResponse } from '../models';
/**
* CastApi - axios parameter creator
* @export
*/
export declare const CastApiAxiosParamCreator: (configuration?: Configuration) => {
/**
* Delete an existing cast. (In order to delete a cast `signer_uuid` must be approved)
* @summary Delete a cast
* @param {DeleteCastReqBody} deleteCastReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-cast)
*
*/
deleteCast: (deleteCastReqBody: DeleteCastReqBody, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Fetch multiple casts using their respective hashes.
* @summary Bulk fetch casts
* @param {string} casts Hashes of the cast to be retrived (Comma separated, no spaces)
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {number} [viewerFid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast.
* @param {FetchBulkCastsSortTypeEnum} [sortType] Optional parameter to sort the casts based on different criteria
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<CastsResponse>} A promise that resolves to a `CastsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-casts)
*
*/
fetchBulkCasts: (casts: string, xNeynarExperimental?: boolean, viewerFid?: number, sortType?: FetchBulkCastsSortTypeEnum, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Fetch casts that quote a given cast
* @summary Cast Quotes
* @param {string} identifier Cast identifier (It\'s either a URL or a hash)
* @param {FetchCastQuotesTypeEnum} type The query param accepted by the API. Sent along with identifier param. url - Cast identifier is a url hash - Cast identifier is a hash
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {number} [viewerFid]
* @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchCastQuotes200Response>} A promise that resolves to a `FetchCastQuotes200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-quotes)
*
*/
fetchCastQuotes: (identifier: string, type: FetchCastQuotesTypeEnum, xNeynarExperimental?: boolean, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Crawls the given URL and returns metadata useful when embedding the URL in a cast.
* @summary Embedded URL metadata
* @param {string} url URL to crawl metadata of
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<CastEmbedCrawlResponse>} A promise that resolves to a `CastEmbedCrawlResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-embedded-url-metadata)
*
*/
fetchEmbeddedUrlMetadata: (url: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Gets information about an individual cast by passing in a Farcaster web URL or cast hash
* @summary By hash or URL
* @param {string} identifier Cast identifier (It\'s either a URL or a hash)
* @param {LookupCastByHashOrUrlTypeEnum} type The query param accepted by the API. Sent along with identifier param. url - Cast identifier is a url hash - Cast identifier is a hash
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {number} [viewerFid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<CastResponse>} A promise that resolves to a `CastResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-or-url)
*
*/
lookupCastByHashOrUrl: (identifier: string, type: LookupCastByHashOrUrlTypeEnum, xNeynarExperimental?: boolean, viewerFid?: number, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* 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.
* @summary Conversation for a cast
* @param {string} identifier Cast identifier (It\'s either a URL or a hash)
* @param {LookupCastConversationTypeEnum} type The query param accepted by the API. Sent along with identifier param. url - Cast identifier is a url hash - Cast identifier is a hash
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {number | null} [replyDepth] The depth of replies in the conversation that will be returned (default 2)
* @param {boolean | null} [includeChronologicalParentCasts] Include all parent casts in chronological order
* @param {number} [viewerFid] Providing this will return a conversation that respects this user\'s mutes and blocks and includes `viewer_context`.
* @param {LookupCastConversationSortTypeEnum} [sortType] Sort type for the ordering of descendants. Default is `chron`
* @param {LookupCastConversationFoldEnum} [fold] 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.
* @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 50)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<Conversation>} A promise that resolves to a `Conversation` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation)
*
*/
lookupCastConversation: (identifier: string, type: LookupCastConversationTypeEnum, xNeynarExperimental?: boolean, replyDepth?: number | null, includeChronologicalParentCasts?: boolean | null, viewerFid?: number, sortType?: LookupCastConversationSortTypeEnum, fold?: LookupCastConversationFoldEnum, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved)
* @summary Post a cast
* @param {PostCastReqBody} postCastReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<PostCastResponse>} A promise that resolves to a `PostCastResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-cast)
*
*/
publishCast: (postCastReqBody: PostCastReqBody, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Search for casts based on a query string, with optional AND filters
* @summary Search for casts
* @param {string} q 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`) |
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {SearchCastsModeEnum} [mode] 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
* @param {SearchCastsSortTypeEnum} [sortType] 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
* @param {number} [authorFid] Fid of the user whose casts you want to search
* @param {number} [viewerFid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`.
* @param {string} [parentUrl] Parent URL of the casts you want to search
* @param {string} [channelId] Channel ID of the casts you want to search
* @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100)
* @param {string} [cursor] Pagination cursor
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<CastsSearchResponse>} A promise that resolves to a `CastsSearchResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-casts)
*
*/
searchCasts: (q: string, xNeynarExperimental?: boolean, mode?: SearchCastsModeEnum, sortType?: SearchCastsSortTypeEnum, authorFid?: number, viewerFid?: number, parentUrl?: string, channelId?: string, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
};
/**
* CastApi - functional programming interface
* @export
*/
export declare const CastApiFp: (configuration?: Configuration) => {
/**
* Delete an existing cast. (In order to delete a cast `signer_uuid` must be approved)
* @summary Delete a cast
* @param {DeleteCastReqBody} deleteCastReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-cast)
*
*/
deleteCast(deleteCastReqBody: DeleteCastReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OperationResponse>>;
/**
* Fetch multiple casts using their respective hashes.
* @summary Bulk fetch casts
* @param {string} casts Hashes of the cast to be retrived (Comma separated, no spaces)
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {number} [viewerFid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast.
* @param {FetchBulkCastsSortTypeEnum} [sortType] Optional parameter to sort the casts based on different criteria
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<CastsResponse>} A promise that resolves to a `CastsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-casts)
*
*/
fetchBulkCasts(casts: string, xNeynarExperimental?: boolean, viewerFid?: number, sortType?: FetchBulkCastsSortTypeEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CastsResponse>>;
/**
* Fetch casts that quote a given cast
* @summary Cast Quotes
* @param {string} identifier Cast identifier (It\'s either a URL or a hash)
* @param {FetchCastQuotesTypeEnum} type The query param accepted by the API. Sent along with identifier param. url - Cast identifier is a url hash - Cast identifier is a hash
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {number} [viewerFid]
* @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchCastQuotes200Response>} A promise that resolves to a `FetchCastQuotes200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-quotes)
*
*/
fetchCastQuotes(identifier: string, type: FetchCastQuotesTypeEnum, xNeynarExperimental?: boolean, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FetchCastQuotes200Response>>;
/**
* Crawls the given URL and returns metadata useful when embedding the URL in a cast.
* @summary Embedded URL metadata
* @param {string} url URL to crawl metadata of
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<CastEmbedCrawlResponse>} A promise that resolves to a `CastEmbedCrawlResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-embedded-url-metadata)
*
*/
fetchEmbeddedUrlMetadata(url: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CastEmbedCrawlResponse>>;
/**
* Gets information about an individual cast by passing in a Farcaster web URL or cast hash
* @summary By hash or URL
* @param {string} identifier Cast identifier (It\'s either a URL or a hash)
* @param {LookupCastByHashOrUrlTypeEnum} type The query param accepted by the API. Sent along with identifier param. url - Cast identifier is a url hash - Cast identifier is a hash
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {number} [viewerFid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<CastResponse>} A promise that resolves to a `CastResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-or-url)
*
*/
lookupCastByHashOrUrl(identifier: string, type: LookupCastByHashOrUrlTypeEnum, xNeynarExperimental?: boolean, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CastResponse>>;
/**
* 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.
* @summary Conversation for a cast
* @param {string} identifier Cast identifier (It\'s either a URL or a hash)
* @param {LookupCastConversationTypeEnum} type The query param accepted by the API. Sent along with identifier param. url - Cast identifier is a url hash - Cast identifier is a hash
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {number | null} [replyDepth] The depth of replies in the conversation that will be returned (default 2)
* @param {boolean | null} [includeChronologicalParentCasts] Include all parent casts in chronological order
* @param {number} [viewerFid] Providing this will return a conversation that respects this user\'s mutes and blocks and includes `viewer_context`.
* @param {LookupCastConversationSortTypeEnum} [sortType] Sort type for the ordering of descendants. Default is `chron`
* @param {LookupCastConversationFoldEnum} [fold] 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.
* @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 50)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<Conversation>} A promise that resolves to a `Conversation` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation)
*
*/
lookupCastConversation(identifier: string, type: LookupCastConversationTypeEnum, xNeynarExperimental?: boolean, replyDepth?: number | null, includeChronologicalParentCasts?: boolean | null, viewerFid?: number, sortType?: LookupCastConversationSortTypeEnum, fold?: LookupCastConversationFoldEnum, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Conversation>>;
/**
* Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved)
* @summary Post a cast
* @param {PostCastReqBody} postCastReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<PostCastResponse>} A promise that resolves to a `PostCastResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-cast)
*
*/
publishCast(postCastReqBody: PostCastReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PostCastResponse>>;
/**
* Search for casts based on a query string, with optional AND filters
* @summary Search for casts
* @param {string} q 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`) |
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {SearchCastsModeEnum} [mode] 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
* @param {SearchCastsSortTypeEnum} [sortType] 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
* @param {number} [authorFid] Fid of the user whose casts you want to search
* @param {number} [viewerFid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`.
* @param {string} [parentUrl] Parent URL of the casts you want to search
* @param {string} [channelId] Channel ID of the casts you want to search
* @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100)
* @param {string} [cursor] Pagination cursor
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<CastsSearchResponse>} A promise that resolves to a `CastsSearchResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-casts)
*
*/
searchCasts(q: string, xNeynarExperimental?: boolean, mode?: SearchCastsModeEnum, sortType?: SearchCastsSortTypeEnum, authorFid?: number, viewerFid?: number, parentUrl?: string, channelId?: string, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CastsSearchResponse>>;
};
/**
* CastApi - factory interface
* @export
*/
export declare const CastApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
/**
* Delete an existing cast. (In order to delete a cast `signer_uuid` must be approved)
* @summary Delete a cast
* @param {CastApiDeleteCastRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-cast)
*
*/
deleteCast(requestParameters: CastApiDeleteCastRequest, options?: RawAxiosRequestConfig): AxiosPromise<OperationResponse>;
/**
* Fetch multiple casts using their respective hashes.
* @summary Bulk fetch casts
* @param {CastApiFetchBulkCastsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<CastsResponse>} A promise that resolves to a `CastsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-casts)
*
*/
fetchBulkCasts(requestParameters: CastApiFetchBulkCastsRequest, options?: RawAxiosRequestConfig): AxiosPromise<CastsResponse>;
/**
* Fetch casts that quote a given cast
* @summary Cast Quotes
* @param {CastApiFetchCastQuotesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchCastQuotes200Response>} A promise that resolves to a `FetchCastQuotes200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-quotes)
*
*/
fetchCastQuotes(requestParameters: CastApiFetchCastQuotesRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchCastQuotes200Response>;
/**
* Crawls the given URL and returns metadata useful when embedding the URL in a cast.
* @summary Embedded URL metadata
* @param {CastApiFetchEmbeddedUrlMetadataRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<CastEmbedCrawlResponse>} A promise that resolves to a `CastEmbedCrawlResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-embedded-url-metadata)
*
*/
fetchEmbeddedUrlMetadata(requestParameters: CastApiFetchEmbeddedUrlMetadataRequest, options?: RawAxiosRequestConfig): AxiosPromise<CastEmbedCrawlResponse>;
/**
* Gets information about an individual cast by passing in a Farcaster web URL or cast hash
* @summary By hash or URL
* @param {CastApiLookupCastByHashOrUrlRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<CastResponse>} A promise that resolves to a `CastResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-or-url)
*
*/
lookupCastByHashOrUrl(requestParameters: CastApiLookupCastByHashOrUrlRequest, options?: RawAxiosRequestConfig): AxiosPromise<CastResponse>;
/**
* 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.
* @summary Conversation for a cast
* @param {CastApiLookupCastConversationRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<Conversation>} A promise that resolves to a `Conversation` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation)
*
*/
lookupCastConversation(requestParameters: CastApiLookupCastConversationRequest, options?: RawAxiosRequestConfig): AxiosPromise<Conversation>;
/**
* Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved)
* @summary Post a cast
* @param {CastApiPublishCastRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<PostCastResponse>} A promise that resolves to a `PostCastResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-cast)
*
*/
publishCast(requestParameters: CastApiPublishCastRequest, options?: RawAxiosRequestConfig): AxiosPromise<PostCastResponse>;
/**
* Search for casts based on a query string, with optional AND filters
* @summary Search for casts
* @param {CastApiSearchCastsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<CastsSearchResponse>} A promise that resolves to a `CastsSearchResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-casts)
*
*/
searchCasts(requestParameters: CastApiSearchCastsRequest, options?: RawAxiosRequestConfig): AxiosPromise<CastsSearchResponse>;
};
/**
* CastApi - interface
* @export
* @interface CastApi
*/
export interface CastApiInterface {
/**
* Delete an existing cast. (In order to delete a cast `signer_uuid` must be approved)
* @summary Delete a cast
* @param {CastApiDeleteCastRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CastApiInterface
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-cast)
*
*/
deleteCast(requestParameters: CastApiDeleteCastRequest, options?: RawAxiosRequestConfig): AxiosPromise<OperationResponse>;
/**
* Fetch multiple casts using their respective hashes.
* @summary Bulk fetch casts
* @param {CastApiFetchBulkCastsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CastApiInterface
* @returns {Promise<CastsResponse>} A promise that resolves to a `CastsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-casts)
*
*/
fetchBulkCasts(requestParameters: CastApiFetchBulkCastsRequest, options?: RawAxiosRequestConfig): AxiosPromise<CastsResponse>;
/**
* Fetch casts that quote a given cast
* @summary Cast Quotes
* @param {CastApiFetchCastQuotesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CastApiInterface
* @returns {Promise<FetchCastQuotes200Response>} A promise that resolves to a `FetchCastQuotes200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-quotes)
*
*/
fetchCastQuotes(requestParameters: CastApiFetchCastQuotesRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchCastQuotes200Response>;
/**
* Crawls the given URL and returns metadata useful when embedding the URL in a cast.
* @summary Embedded URL metadata
* @param {CastApiFetchEmbeddedUrlMetadataRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CastApiInterface
* @returns {Promise<CastEmbedCrawlResponse>} A promise that resolves to a `CastEmbedCrawlResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-embedded-url-metadata)
*
*/
fetchEmbeddedUrlMetadata(requestParameters: CastApiFetchEmbeddedUrlMetadataRequest, options?: RawAxiosRequestConfig): AxiosPromise<CastEmbedCrawlResponse>;
/**
* Gets information about an individual cast by passing in a Farcaster web URL or cast hash
* @summary By hash or URL
* @param {CastApiLookupCastByHashOrUrlRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CastApiInterface
* @returns {Promise<CastResponse>} A promise that resolves to a `CastResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-or-url)
*
*/
lookupCastByHashOrUrl(requestParameters: CastApiLookupCastByHashOrUrlRequest, options?: RawAxiosRequestConfig): AxiosPromise<CastResponse>;
/**
* 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.
* @summary Conversation for a cast
* @param {CastApiLookupCastConversationRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CastApiInterface
* @returns {Promise<Conversation>} A promise that resolves to a `Conversation` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation)
*
*/
lookupCastConversation(requestParameters: CastApiLookupCastConversationRequest, options?: RawAxiosRequestConfig): AxiosPromise<Conversation>;
/**
* Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved)
* @summary Post a cast
* @param {CastApiPublishCastRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CastApiInterface
* @returns {Promise<PostCastResponse>} A promise that resolves to a `PostCastResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-cast)
*
*/
publishCast(requestParameters: CastApiPublishCastRequest, options?: RawAxiosRequestConfig): AxiosPromise<PostCastResponse>;
/**
* Search for casts based on a query string, with optional AND filters
* @summary Search for casts
* @param {CastApiSearchCastsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CastApiInterface
* @returns {Promise<CastsSearchResponse>} A promise that resolves to a `CastsSearchResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-casts)
*
*/
searchCasts(requestParameters: CastApiSearchCastsRequest, options?: RawAxiosRequestConfig): AxiosPromise<CastsSearchResponse>;
}
/**
* Request parameters for deleteCast operation in CastApi.
* @export
* @interface CastApiDeleteCastRequest
*/
export interface CastApiDeleteCastRequest {
/**
*
*
*
*
* @type {DeleteCastReqBody}
* @memberof CastApiDeleteCast
*/
readonly deleteCastReqBody: DeleteCastReqBody;
}
/**
* Request parameters for fetchBulkCasts operation in CastApi.
* @export
* @interface CastApiFetchBulkCastsRequest
*/
export interface CastApiFetchBulkCastsRequest {
/**
* Hashes of the cast to be retrived (Comma separated, no spaces)
*
* @commaSeparated
*
* @type {string}
* @memberof CastApiFetchBulkCasts
*/
readonly casts: string;
/**
* Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
*
*
* @globalHeader
* @type {boolean}
* @memberof CastApiFetchBulkCasts
*/
readonly xNeynarExperimental?: boolean;
/**
* adds viewer_context to cast object to show whether viewer has liked or recasted the cast.
*
*
*
* @type {number}
* @memberof CastApiFetchBulkCasts
*/
readonly viewerFid?: number;
/**
* Optional parameter to sort the casts based on different criteria
*
*
*
* @type {'trending' | 'likes' | 'recasts' | 'replies' | 'recent'}
* @memberof CastApiFetchBulkCasts
*/
readonly sortType?: FetchBulkCastsSortTypeEnum;
}
/**
* Request parameters for fetchCastQuotes operation in CastApi.
* @export
* @interface CastApiFetchCastQuotesRequest
*/
export interface CastApiFetchCastQuotesRequest {
/**
* Cast identifier (It\'s either a URL or a hash)
*
*
*
* @type {string}
* @memberof CastApiFetchCastQuotes
*/
readonly identifier: string;
/**
* The query param accepted by the API. Sent along with identifier param. url - Cast identifier is a url hash - Cast identifier is a hash
*
*
*
* @type {'url' | 'hash'}
* @memberof CastApiFetchCastQuotes
*/
readonly type: FetchCastQuotesTypeEnum;
/**
* Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
*
*
* @globalHeader
* @type {boolean}
* @memberof CastApiFetchCastQuotes
*/
readonly xNeynarExperimental?: boolean;
/**
*
*
*
*
* @type {number}
* @memberof CastApiFetchCastQuotes
*/
readonly viewerFid?: number;
/**
* Number of results to fetch (Default: 25, Maximum: 100)
*
*
*
* @type {number}
* @memberof CastApiFetchCastQuotes
*/
readonly limit?: number;
/**
* Pagination cursor.
*
*
*
* @type {string}
* @memberof CastApiFetchCastQuotes
*/
readonly cursor?: string;
}
/**
* Request parameters for fetchEmbeddedUrlMetadata operation in CastApi.
* @export
* @interface CastApiFetchEmbeddedUrlMetadataRequest
*/
export interface CastApiFetchEmbeddedUrlMetadataRequest {
/**
* URL to crawl metadata of
*
*
*
* @type {string}
* @memberof CastApiFetchEmbeddedUrlMetadata
*/
readonly url: string;
}
/**
* Request parameters for lookupCastByHashOrUrl operation in CastApi.
* @export
* @interface CastApiLookupCastByHashOrUrlRequest
*/
export interface CastApiLookupCastByHashOrUrlRequest {
/**
* Cast identifier (It\'s either a URL or a hash)
*
*
*
* @type {string}
* @memberof CastApiLookupCastByHashOrUrl
*/
readonly identifier: string;
/**
* The query param accepted by the API. Sent along with identifier param. url - Cast identifier is a url hash - Cast identifier is a hash
*
*
*
* @type {'url' | 'hash'}
* @memberof CastApiLookupCastByHashOrUrl
*/
readonly type: LookupCastByHashOrUrlTypeEnum;
/**
* Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
*
*
* @globalHeader
* @type {boolean}
* @memberof CastApiLookupCastByHashOrUrl
*/
readonly xNeynarExperimental?: boolean;
/**
* adds viewer_context to cast object to show whether viewer has liked or recasted the cast.
*
*
*
* @type {number}
* @memberof CastApiLookupCastByHashOrUrl
*/
readonly viewerFid?: number;
}
/**
* Request parameters for lookupCastConversation operation in CastApi.
* @export
* @interface CastApiLookupCastConversationRequest
*/
export interface CastApiLookupCastConversationRequest {
/**
* Cast identifier (It\'s either a URL or a hash)
*
*
*
* @type {string}
* @memberof CastApiLookupCastConversation
*/
readonly identifier: string;
/**
* The query param accepted by the API. Sent along with identifier param. url - Cast identifier is a url hash - Cast identifier is a hash
*
*
*
* @type {'url' | 'hash'}
* @memberof CastApiLookupCastConversation
*/
readonly type: LookupCastConversationTypeEnum;
/**
* Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
*
*
* @globalHeader
* @type {boolean}
* @memberof CastApiLookupCastConversation
*/
readonly xNeynarExperimental?: boolean;
/**
* The depth of replies in the conversation that will be returned (default 2)
*
*
*
* @type {number}
* @memberof CastApiLookupCastConversation
*/
readonly replyDepth?: number | null;
/**
* Include all parent casts in chronological order
*
*
*
* @type {boolean}
* @memberof CastApiLookupCastConversation
*/
readonly includeChronologicalParentCasts?: boolean | null;
/**
* Providing this will return a conversation that respects this user\'s mutes and blocks and includes `viewer_context`.
*
*
*
* @type {number}
* @memberof CastApiLookupCastConversation
*/
readonly viewerFid?: number;
/**
* Sort type for the ordering of descendants. Default is `chron`
*
*
*
* @type {'chron' | 'desc_chron' | 'algorithmic'}
* @memberof CastApiLookupCastConversation
*/
readonly sortType?: LookupCastConversationSortTypeEnum;
/**
* 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.
*
*
*
* @type {'above' | 'below'}
* @memberof CastApiLookupCastConversation
*/
readonly fold?: LookupCastConversationFoldEnum;
/**
* Number of results to fetch (Default: 20, Maximum: 50)
*
*
*
* @type {number}
* @memberof CastApiLookupCastConversation
*/
readonly limit?: number;
/**
* Pagination cursor.
*
*
*
* @type {string}
* @memberof CastApiLookupCastConversation
*/
readonly cursor?: string;
}
/**
* Request parameters for publishCast operation in CastApi.
* @export
* @interface CastApiPublishCastRequest
*/
export interface CastApiPublishCastRequest {
/**
*
*
*
*
* @type {PostCastReqBody}
* @memberof CastApiPublishCast
*/
readonly postCastReqBody: PostCastReqBody;
}
/**
* Request parameters for searchCasts operation in CastApi.
* @export
* @interface CastApiSearchCastsRequest
*/
export interface CastApiSearchCastsRequest {
/**
* 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`) |
*
*
*
* @type {string}
* @memberof CastApiSearchCasts
*/
readonly q: string;
/**
* Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
*
*
* @globalHeader
* @type {boolean}
* @memberof CastApiSearchCasts
*/
readonly xNeynarExperimental?: boolean;
/**
* 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
*
*
*
* @type {'literal' | 'semantic' | 'hybrid'}
* @memberof CastApiSearchCasts
*/
readonly mode?: SearchCastsModeEnum;
/**
* 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
*
*
*
* @type {'desc_chron' | 'chron' | 'algorithmic'}
* @memberof CastApiSearchCasts
*/
readonly sortType?: SearchCastsSortTypeEnum;
/**
* Fid of the user whose casts you want to search
*
*
*
* @type {number}
* @memberof CastApiSearchCasts
*/
readonly authorFid?: number;
/**
* Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`.
*
*
*
* @type {number}
* @memberof CastApiSearchCasts
*/
readonly viewerFid?: number;
/**
* Parent URL of the casts you want to search
*
*
*
* @type {string}
* @memberof CastApiSearchCasts
*/
readonly parentUrl?: string;
/**
* Channel ID of the casts you want to search
*
*
*
* @type {string}
* @memberof CastApiSearchCasts
*/
readonly channelId?: string;
/**
* Number of results to fetch (Default: 25, Maximum: 100)
*
*
*
* @type {number}
* @memberof CastApiSearchCasts
*/
readonly limit?: number;
/**
* Pagination cursor
*
*
*
* @type {string}
* @memberof CastApiSearchCasts
*/
readonly cursor?: string;
}
/**
* CastApi - object-oriented interface
* @export
* @class CastApi
* @extends {BaseAPI}
*/
export declare class CastApi extends BaseAPI implements CastApiInterface {
/**
* Delete an existing cast. (In order to delete a cast `signer_uuid` must be approved)
* @summary Delete a cast
* @param {CastApiDeleteCastRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CastApi
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/refere