fetchProfileStats

Fetches profile statistics (followers and following counts) for a given address, ENS name, or list.

Usage

import { fetchProfileStats } from 'ethereum-identity-kit'
// For server-side usage
import { fetchProfileStats } from 'ethereum-identity-kit/utils'
 
const stats = await fetchProfileStats('vitalik.eth')
// or for a list
const listStats = await fetchProfileStats('0x...', 1)
// or with live data
const liveStats = await fetchProfileStats('vitalik.eth', undefined, true)

Parameters

ParameterTypeDescription
addressOrNamestringEthereum address or ENS name to fetch stats for
listProfileListTypeOptional list number to fetch stats for
isLivebooleanOptional flag to fetch live data bypassing cache

Return Value

Returns a StatsResponse object containing follower and following counts, or default values if the request fails.

Example Response

{
  followers_count: 1234,
  following_count: 567
}