Pulsar GraphQL API

Wyślij zapytanie do /pulsar/graphql z kluczem API. Jedno żądanie przechodzi przez strony → weryfikację → monitory, więc pobierasz dokładnie te pola, których potrzebujesz w jednym wywołaniu.

01Schemat

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
}

02Przykładowe zapytanie

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 }
  }
}

03Wywołaj to

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 } } }"}'

Tylko do odczytu: mutacje, subskrypcje i fragmenty nie są obsługiwane. Każda liczba to rzeczywisty werdykt konsensusu urządzeń — pole jest puste, gdy sieć jeszcze nie podjęła decyzji. Wywołania liczą się do twojego dziennego limitu API.

Na co odpowiada ta strona

  • jedno zapytanie GraphQL dla stron
  • monitorować werdykty kworum
  • jedno zapytanie dla wszystkich danych strony
  • co to jest API GraphQL Pulsar
  • jak działa API GraphQL Pulsar
  • API GraphQL Pulsar wyjaśnione
  • API GraphQL Pulsar przewodnik
  • jak zacząć z API GraphQL Pulsar
  • recenzje API GraphQL Pulsar
  • czy API GraphQL Pulsar jest tego warte
  • cennik API GraphQL Pulsar
  • API GraphQL Pulsar alternatywy
  • API GraphQL Pulsar dla początkujących
  • dlaczego API GraphQL Pulsar
  • API GraphQL Pulsar — co otrzymujesz