getting started
welcome to farcaster kit! we can't wait to see what you build
farcaster kit is made up of two parts:
- a rest api to access app-first data
- a npm package with react hooks and modules
API docs
casts/:hash
a GET request that returns a cast given its hash
input:
- hash - string
- cursor - number(optional)
- limit - number(optional, max = 100)
casts/latest
a GET request that returns the latest casts on farcaster
input:
- fid - number(optional)
- parent_url - string(optional)
- cursor - number(optional)
- 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:
- hash - string
- cursor - number(optional)
- limit - number(optional, max = 100)
casts/search
a GET request that searches casts given a query
input:
- query - string
- cursor - number(optional)
- limit - number(optional, max = 100)
users/user
a GET request that returns profile data for a given a fid or fname
input:
- fid - number(optional)
- fname - string(optional)
- cursor - number(optional)
- 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:
- fid - number(optional)
- parent_url - string(optional)
- cursor - number(optional)
- 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:
- hash - string
- cursor - number(optional)
- limit - number(optional, max = 100)
usage:
const {data, loading} = useCast({hash: '0x62795a62dbd04b94427f464f191986fcc00d81ab'})
useReplies
get replies to a given cast
input:
- hash - string
- cursor - number(optional)
- limit - number(optional, max = 100)
usage:
const {data, loading} = useReplies({hash: '0x62795a62dbd04b94427f464f191986fcc00d81ab'})
useSearch
search casts given a query
input:
- query - string
- cursor - number(optional)
- limit - number(optional, max = 100)
usage:
const {data, loading} = useSearch({query: 'farcaster'})
useUser
get profile data for a given a fid or fname
input:
- fid - number(optional)
- fname - string(optional)
- cursor - number(optional)
- limit - number(optional, max = 100)
usage:
const {data, loading} = useUser({fname: 'dylsteck.eth'})