GraphQL API
View this page as MarkdownBest for integrating Politigraph data into a website, application, or other workflows by writing a GraphQL query and sending it to the API to fetch the data you need.
Our API adheres to the GraphQL standard, which you can query at https://politigraph.wevis.info/graphql through a GraphQL Client or HTTP POST Request. For example:
import { ApolloClient, HttpLink, InMemoryCache, gql } from '@apollo/client';
const client = new ApolloClient({ link: new HttpLink({ uri: 'https://politigraph.wevis.info/graphql', headers: { 'apollographql-client-name': 'my-app' }, }), cache: new InMemoryCache(),});
const { data } = await client.query({ query: gql` query { people(where: { firstname_en: { eq: "Anutin" } }) { id name_en } } `,});curl https://politigraph.wevis.info/graphql \ -H 'Content-Type: application/json' \ -H 'apollographql-client-name: my-app' \ -d '{"query": "query { people(where: { firstname_en: { eq: \"Anutin\" } }) { id name_en } }"}'Identifying Your Application
Section titled “Identifying Your Application”If you call the API from a server, script, or SSR, please send the apollographql-client-name header and, optionally, apollographql-client-version so we can see usage statistics. Requests from a browser are already identified by their origin automatically.

