API GraphQL Pulsar

POST une requête à /pulsar/graphql avec votre clé API. Une requête parcourt les sites → vérification → moniteurs, vous permettant de récupérer exactement les champs dont vous avez besoin en un seul appel.

01Schéma

GraphQL SDL
type Query {
  me: Member
  network: NetworkStats
  sites: [Site!]!
  site(domain: String!): Site
  shopfront(hash: String!): Shopfront   # verify a hash embedded in an honest-shopfront SVG
}
type Member { id: Int!  email: String!  plan: String }
type NetworkStats {
  devicesLive: Int!   devicesEnrolled: Int!   countries: Int!
  verdicts24h: Int!   ok24h: Int!   okPct: Float   snapshots: Int!
}
type Site {
  id: Int!   domain: String!   title: String   seoScore: Int
  verified: PulsarVerification         # null until the network has checked it
  monitors: [Monitor!]!
  traffic(days: Int = 30): Traffic     # same aggregates the dashboard shows
  leads(days: Int = 30): Leads
  topPages(days: Int = 7, limit: Int = 10): [PageStat!]!
}
type PulsarVerification { verified: Boolean!  checks: Int!  uptimePct: Int  latencyMs: Int  lastCheckedAt: String }
type Monitor {
  id: Int!  name: String!  kind: String!
  up: Boolean   ttfbMs: Int   loadMs: Int   tlsDaysLeft: Int   vantagePoints: Int
  tlsVersion: String   tlsCipher: String   tlsFailure: String   tlsChainIncomplete: Boolean
}
type Traffic {
  days: Int!   visitors: Int!   pageviews: Int!
  avgVisitorsPerDay: Float      # null when there are no days with data
  series: [TrafficDay!]!
}
type TrafficDay { day: String!  visitors: Int!  visits: Int!  pageviews: Int! }
type Leads { total: Int!  unhandled: Int! }
type PageStat { url: String!  views: Int! }
type Shopfront {                      # idea 24: the statement behind a plaque, checked against our ledger
  hash: String!   status: String!     # active | superseded | broken | unknown
  site: String    builtAt: String     currentAt: String   shown: Boolean   # shown = the plaque is served right now
  sigValid: Boolean   digestValid: Boolean   pubkey: String   statement: String   sig: String   verdictRoot: String
  facts: String                       # canonical JSON of the signed figures
}

02Requête d'exemple

query
{
  network { devicesLive countries verdicts24h okPct }
  sites {
    domain
    traffic(days: 30) { visitors pageviews avgVisitorsPerDay }
    leads(days: 30) { total unhandled }
    topPages(days: 7, limit: 5) { url views }
    verified { uptimePct latencyMs checks }
    monitors { name kind up loadMs tlsDaysLeft }
  }
}

03Appelez-le

curl
curl -s https://astrina.io/pulsar/graphql \
  -H 'X-Api-Key: YOUR_KEY' -H 'Content-Type: application/json' \
  -d '{"query":"{ network { devicesLive } sites { domain verified { uptimePct } } }"}'

Lecture seule : les mutations, abonnements et fragments ne sont pas pris en charge. Chaque nombre est un verdict réel de consensus d'appareils — un champ est nul lorsque le réseau n'a pas encore décidé. Les appels comptent contre votre quota quotidien d'API.

Ce que cette page répond

  • une requête GraphQL pour les sites
  • surveiller les verdicts de quorum
  • une requête pour toutes les données du site
  • qu'est-ce que l'API GraphQL Pulsar
  • comment l'API GraphQL Pulsar fonctionne
  • l'API GraphQL Pulsar expliqué
  • guide l'API GraphQL Pulsar
  • comment commencer avec l'API GraphQL Pulsar
  • avis sur l'API GraphQL Pulsar
  • est-ce que l'API GraphQL Pulsar en vaut la peine
  • tarification de l'API GraphQL Pulsar
  • l'API GraphQL Pulsar alternatives
  • l'API GraphQL Pulsar pour les débutants
  • pourquoi l'API GraphQL Pulsar
  • l'API GraphQL Pulsar — ce que vous obtenez