Sismo Docs
  • Welcome to Sismo
    • What is Sismo?
  • Build with Sismo Connect
    • Overview
    • Installation
    • Sismo Connect Cheatsheet
    • Tutorials
      • Get Your appId - Create a Sismo Connect App
      • Onchain Tutorial (1/2): Code Your Airdrop Contract With Privately-Aggregated Data
      • Onchain Tutorial (2/2): Deploy Your Airdrop Contract
    • Technical Documentation
      • Sismo Connect Configuration
      • Auths
      • Claims
      • Signature
      • Packages
        • Sismo Connect Client: Request
        • Sismo Connect React: Request
        • Sismo Connect Server: Verify Offchain
        • Sismo Connect Solidity Library: Verify Onchain
    • FAQ
  • Data Groups
    • Overview
    • Tutorials
      • Factory Guide: Create a Data Group in 5 Minutes
      • Sismo Hub Guide: Create Data Groups Programmatically
      • Sismo Hub Guide: Add a Data Provider to the Sismo Factory
    • Sismo Hub
      • Sismo Hub Repository
        • Group Generators
        • Data Providers
        • Data Operators
        • Command Line Interface
      • Accounts Registry Tree
  • Data Vault
    • Overview
    • Vault Identifiers
    • Proving Schemes
      • Hydra-S1
      • Hydra-S2
    • Commitment Mapper
  • Resources
    • Deployed Contract Addresses
    • Sismo API
      • API Links
      • Query From a Client
      • Group
        • Get groups
        • Get group snapshots
      • Common Parameters
      • Advanced Filtering
      • Transaction
  • Links
    • Sismo Landing Page
    • Sismo Factory
    • Sismo App Store
    • Sismo Builder Resources
    • GitHub
    • Discord
    • Twitter
    • Blog
Powered by GitBook
On this page
  • Get the latest snapshot
  • Get a snapshot at a specific timestamp
  1. Resources
  2. Sismo API
  3. Group

Get group snapshots

Query toolkit to fetch group snapshots

Group snapshots store the data of a group at a specific timestamp. You can easily know the data of any group by knowing the groupId or the groupName and the associated timestamp.

Get the latest snapshot

You can query the latest snapshot by specifying the groupId or the groupName.

query getSnapshot {
  groupSnapshot(
    groupId: "0x682544d549b8a461d7fe3e589846bb7b",
  ) {
    id
    dataUrl
    size
    timestamp
    valueDistribution {
      numberOfAccounts
      value
    }
  }
}
query getSnapshot {
  groupSnapshot(
    groupName: "proof-of-humanity",
  ) {
    id
    dataUrl
    size
    timestamp
    valueDistribution {
      numberOfAccounts
      value
    }
  }
}
{
  "data": {
    "groupSnapshot": {
      "id": "0x682544d549b8a461d7fe3e589846bb7b6c617465737400000000000000000000",
      "dataUrl": "https://sismo-prod-hub-data.s3.eu-west-1.amazonaws.com/group-snapshot-store/0x682544d549b8a461d7fe3e589846bb7b/1678111868.json",
      "size": 16932,
      "timestamp": "latest",
      "valueDistribution": [
        {
          "numberOfAccounts": 16932,
          "value": "1"
        }
      ]
    }
  }
}

Get a snapshot at a specific timestamp

query getSnapshotWithTimestamp {
  groupSnapshot(
    groupName: "proof-of-humanity",
    timestamp: "1675692588"
  ) {
    id
    dataUrl
    size
    timestamp
    valueDistribution {
      numberOfAccounts
      value
    }
  }
}
{
  "data": {
    "groupSnapshot": {
      "id": "0x682544d549b8a461d7fe3e589846bb7b00000000000000000000000063e10a2c",
      "dataUrl": "https://sismo-prod-hub-data.s3.eu-west-1.amazonaws.com/group-snapshot-store/0x682544d549b8a461d7fe3e589846bb7b/1675692588.json",
      "size": 16834,
      "timestamp": "1675692588",
      "valueDistribution": [
        {
          "numberOfAccounts": 16834,
          "value": "1"
        }
      ]
    }
  }
}
PreviousGet groupsNextCommon Parameters

Last updated 1 year ago