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
  1. Resources
  2. Sismo API

Query From a Client

PreviousAPI LinksNextGroup

Last updated 1 year ago

There are several ways to query our GraphQL API :

GraphQL Client

You can use any GraphQL client. Here is an example with Apollo Client:

import { ApolloClient, InMemoryCache, gql } from '@apollo/client';

const client = new ApolloClient({
  uri: 'https://api.sismo.io',
  cache: new InMemoryCache(),
});
const query = gql`
query {
  mintedBadges {
    balance
    tokenId
    badge {
      name
    }
  }
}`
const result = await client.query({ query });
POST Request
const query = `
query {
  mintedBadges {
    level
    badge {
      tokenId
    }
    badge {
      name
    }
  }
}`

const res = await fetch('https://api.sismo.io', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
  },
  body: JSON.stringify({ query})
});
const { data, errors } = await res.json();

cURL
curl -g \
-X POST https://api.sismo.io/ \
-H "Content-Type: application/json" \
--data-binary @- << EOF
{
  "query": "query { mintedBadges { level badge { tokenId } badge { name } } }"
}
EOF
Sismo API Explorer
Visit the Explorer and interact with our API
Logo