
GraphQL Extractor
Pricing
Pay per usage
Go to Store

GraphQL Extractor
π« Universal GraphQL Scraper
0.0 (0)
Pricing
Pay per usage
1
Total users
17
Monthly users
4
Runs succeeded
68%
Last modified
7 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.
1from apify_client import ApifyClient2
3# Initialize the ApifyClient with your Apify API token4# Replace '<YOUR_API_TOKEN>' with your token.5client = ApifyClient("<YOUR_API_TOKEN>")6
7# Prepare the Actor input8run_input = {9 "limit": 100,10 "url": "https://apify.hashnode.dev/api/graphql",11 "query": """query ($host: String!, $after: String, $first: Int!, $filter: PublicationPostConnectionFilter) {\r12 publication(host: $host) {\r13 id\r14 posts(after: $after, first: $first, filter: $filter) {\r15 edges {\r16 node {\r17 __typename id title subtitle slug publishedAt url brief\r18 }\r19 __typename\r20 }\r21 pageInfo { hasNextPage endCursor __typename }\r22 totalDocuments\r23 __typename\r24 }\r25 __typename\r26 }\r27}""",28 "variables": "{ \"host\": \"apify.hashnode.dev\", \"first\": 10 }",29 "cursor.step": 25,30 "cursor.index": "",31 "cursor.next": "after",32 "cursor.offset": "",33 "cursor.limit": "first",34 "parse.root": "publication.posts",35 "parse.list": "edges",36 "parse.item": "node",37 "parse.total": "totalDocuments",38 "parse.next": "pageInfo.endCursor",39}40
41# Run the Actor and wait for it to finish42run = client.actor("jupri/graphql-extractor").call(run_input=run_input)43
44# Fetch and print Actor results from the run's dataset (if there are any)45print("πΎ Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])46for item in client.dataset(run["defaultDatasetId"]).iterate_items():47 print(item)48
49# π Want to learn more π? Go to β https://docs.apify.com/api/client/python/docs/quick-start
GraphQL Extractor API in Python
The Apify API client for Python is the official library that allows you to use GraphQL Extractor API in Python, providing convenience functions and automatic retries on errors.
Install the apify-client
$pip install apify-client
Other API clients include: