getting started

welcome to farcaster kit! we can't wait to see what you build

farcaster kit is made up of two parts:

  1. a rest api to access app-first data
  2. a npm package with react hooks and modules

API docs

casts/:hash

a GET request that returns a cast given its hash

input:

  1. hash - string
  2. cursor - number(optional)
  3. limit - number(optional, max = 100)

casts/latest

a GET request that returns the latest casts on farcaster

input:

  1. fid - number(optional)
  2. parent_url - string(optional)
  3. cursor - number(optional)
  4. limit - number(optional, max = 100)

note: passing fid or parent_url gets you the feed for either, but right now you can only input one of them -- not both

casts/replies

a GET request that returns all replies to a cast

input:

  1. hash - string
  2. cursor - number(optional)
  3. limit - number(optional, max = 100)

casts/search

a GET request that searches casts given a query

input:

  1. query - string
  2. cursor - number(optional)
  3. limit - number(optional, max = 100)

users/user

a GET request that returns profile data for a given a fid or fname

input:

  1. fid - number(optional)
  2. fname - string(optional)
  3. cursor - number(optional)
  4. limit - number(optional, max = 100)

note: you must pass either fid or fname, and not both

utils/warpcastChannels

a GET request that returns a list of all channels in Warpcast

React hooks docs

useLatestCasts

get the latest casts on farcaster

input:

  1. fid - number(optional)
  2. parent_url - string(optional)
  3. cursor - number(optional)
  4. limit - number(optional, max = 100)

usage:

const {data, loading} = useLatestCasts()

const {data, loading} = useLatestCasts({fid: 616})

const {data, loading} = useLatestCasts({parent_url: 'https://warpcast.com'})

useCast

get a cast by hash

input:

  1. hash - string
  2. cursor - number(optional)
  3. limit - number(optional, max = 100)

usage:

const {data, loading} = useCast({hash: '0x62795a62dbd04b94427f464f191986fcc00d81ab'})

useReplies

get replies to a given cast

input:

  1. hash - string
  2. cursor - number(optional)
  3. limit - number(optional, max = 100)

usage:

const {data, loading} = useReplies({hash: '0x62795a62dbd04b94427f464f191986fcc00d81ab'})

useSearch

search casts given a query

input:

  1. query - string
  2. cursor - number(optional)
  3. limit - number(optional, max = 100)

usage:

const {data, loading} = useSearch({query: 'farcaster'})

useUser

get profile data for a given a fid or fname

input:

  1. fid - number(optional)
  2. fname - string(optional)
  3. cursor - number(optional)
  4. limit - number(optional, max = 100)

usage:

const {data, loading} = useUser({fname: 'dylsteck.eth'})

Farcaster Icon
Github icon