Using the API
The API can be called from any programming language or browser by making a normal HTTP request. View the API responses in a browser Simply open the URL in a browserResponse encoding
Responses from the API are encoded asapplication/json, and can be parsed as normal JSON objects.
- Hashes, ETH addresses, keys etc… are all encoded as hex strings starting with
0x - Signatures and other binary fields are encoded in base64
- Constants are encoded as their string types. For example, the
hashSchemeis encoded asHASH_SCHEME_BLAKE3which is equivalent to theHASH_SCHEME_BLAKE3 = 1from the protobuf schema.
Timestamps
Messages contain timestamps which are seconds since the Farcaster Epoch, which began on Jan 1, 2021 00:00:00 UTC.Paging
Most endpoints support paging to get a large number of responses. Pagination Query Parameters| Parameter | Description | Example |
|---|---|---|
| pageSize | Maximum number of messages to return in a single response | pageSize=100 |
| reverse | Reverse the sort order, returning latest messages first | reverse=1 |
| pageToken | The page token returned by the previous query, to fetch the next page. If this parameters is empty, fetch the first page | pageToken=AuzO1V0Dta...fStlynsGWT |
nextPageToken is empty if there are no more pages to return.
Pagination query parameters can be combined with other query parameters supported by the endpoint. For example, /v1/casts?fid=2&pageSize=3.
Example
Fetch all casts by FID 2, fetching upto 3 casts per Page
Timestamp Filtering
Some endpoints support filtering by timestamp, allowing you to retrieve results within a specific time range:| Parameter | Description | Example |
|---|---|---|
| startTimestamp | Start of the time range (inclusive) | startTimestamp=1000 |
| stopTimestamp | End of the time range (inclusive) | stopTimestamp=2000 |
Handling Errors
If there’s an API error, the HTTP status code is set to400 or 500 as appropriate. The response is a JSON object with detail, errCode and metadata fields set to identify and debug the errors.
Example

