Hubs are peer to peer servers that work together to download and serve both onchain and offchain data for the Farcaster network. They are key to keeping the network running and for allowing developers to build apps on top of Farcaster. Any time you need to access data from Farcaster such as messages, users, or events, you’ll need to access it in the form of a Hub. Sometimes this might take place in the raw Hub API or through an abstraction.

Pinata offers free to use Hubs that can be accessed via API:

Or through gRPC:
Pinata runs its Hubs through a proxy so the standard 2281 port is not required


The Hub API can be used like any other API to fetch data like so:

curl --request GET \
  --url ''

For more info on how to use the Hub API, check out our Hub API Reference.

Hub gRPC

The gRPC endpoint can be used inside the hub-nodejs library and provides a level of abstraction.

import { getSSLHubRpcClient } from '@farcaster/hub-nodejs';

const hubRpcEndpoint = '';
const client = getSSLHubRpcClient(hubRpcEndpoint);

client.$.waitForReady( + 5000, (e) => {
  if (e) {
    console.error(`Failed to connect to ${hubRpcEndpoint}:`, e);
  } else {
    console.log(`Connected to ${hubRpcEndpoint}`);

    client.getCastsByFid({ fid: 6023 }).then((castsResult) => { => console.log(casts.messages));

Please consult the hub-nodejs documentation for more info on how to use it.