
GraphQL Extractor
Pricing
Pay per usage
Go to Store

GraphQL Extractor
💫 Universal GraphQL Scraper
0.0 (0)
Pricing
Pay per usage
1
Total users
18
Monthly users
5
Runs succeeded
>99%
Last modified
8 months ago
You can access the GraphQL Extractor programmatically from your own applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.
1import { ApifyClient } from 'apify-client';2
3// Initialize the ApifyClient with your Apify API token4// Replace the '<YOUR_API_TOKEN>' with your token5const client = new ApifyClient({6 token: '<YOUR_API_TOKEN>',7});8
9// Prepare Actor input10const input = {11 "limit": 100,12 "url": "https://apify.hashnode.dev/api/graphql",13 "query": `query ($host: String!, $after: String, $first: Int!, $filter: PublicationPostConnectionFilter) {14 publication(host: $host) {15 id16 posts(after: $after, first: $first, filter: $filter) {17 edges {18 node {19 __typename id title subtitle slug publishedAt url brief20 }21 __typename22 }23 pageInfo { hasNextPage endCursor __typename }24 totalDocuments25 __typename26 }27 __typename28 }29 }`,30 "variables": "{ \"host\": \"apify.hashnode.dev\", \"first\": 10 }",31 "cursor.step": 25,32 "cursor.index": "",33 "cursor.next": "after",34 "cursor.offset": "",35 "cursor.limit": "first",36 "parse.root": "publication.posts",37 "parse.list": "edges",38 "parse.item": "node",39 "parse.total": "totalDocuments",40 "parse.next": "pageInfo.endCursor"41};42
43// Run the Actor and wait for it to finish44const run = await client.actor("jupri/graphql-extractor").call(input);45
46// Fetch and print Actor results from the run's dataset (if any)47console.log('Results from dataset');48console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);49const { items } = await client.dataset(run.defaultDatasetId).listItems();50items.forEach((item) => {51 console.dir(item);52});53
54// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs
GraphQL Extractor API in JavaScript
The Apify API client for JavaScript is the official library that allows you to use GraphQL Extractor API in JavaScript or TypeScript, providing convenience functions and automatic retries on errors.
Install the apify-client
$npm install apify-client
Other API clients include: