Docs
API
Stats
Lens Protocol Stats

Lens Protocol Stats

Lens Protocol Stats API stats() returns the global protocol stats.

API operation

lensjs
  .GetGlobalProtocolStats()
  .then((res) => {
    console.log(res);
  })
  .catch((err) => {
    console.log(err);
  });

API response

{
  "globalProtocolStats": {
    "totalProfiles": 291,
    "totalBurntProfiles": 10,
    "totalPosts": 186,
    "totalMirrors": 23,
    "totalComments": 59,
    "totalCollects": 19,
    "totalFollows": 85,
    "totalRevenue": [
      {
        "asset": {
          "name": "Wrapped Matic",
          "symbol": "WMATIC",
          "decimals": 18,
          "address": "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889"
        },
        "value": "6.94648"
      }
    ]
  }
}

Full Code Example

import lensjs from 'lensjs';
import { useEffect } from 'react';

export default function Example() {
  useEffect(() => {
    lensjs
      .GetGlobalProtocolStats()
      .then((res) => {
        console.log(res);
      })
      .catch((err) => {
        console.log(err);
      });
  }, []);
}