Zenrows

Learn how to use Zenrows with Composio

Overview

SLUG: ZENROWS

Description

ZenRows is a web scraping API allowing developers to bypass CAPTCHAs and blocks, gather structured data from dynamic websites, and quickly integrate results into applications

Authentication Details

username
stringRequired
password
stringRequired
generic_api_key
stringRequired

Connecting to Zenrows

Create an auth config

Use the dashboard to create an auth config for the Zenrows toolkit. This allows you to connect multiple Zenrows accounts to Composio for agents to use.

1

Select App

Navigate to the Zenrows toolkit page and click “Setup Integration”.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Integration”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2from composio.types import auth_scheme
3
4# Replace these with your actual values
5zenrows_auth_config_id = "ac_YOUR_ZENROWS_CONFIG_ID" # Auth config ID created above
6user_id = "0000-0000-0000" # UUID from database/app
7
8composio = Composio()
9
10def authenticate_toolkit(user_id: str, auth_config_id: str):
11 # Replace this with a method to retrieve an API key from the user.
12 # Or supply your own.
13 user_api_key = input("[!] Enter API key")
14
15 connection_request = composio.connected_accounts.initiate(
16 user_id=user_id,
17 auth_config_id=auth_config_id,
18 config={"auth_scheme": "API_KEY", "val": user_api_key}
19 )
20
21 # API Key authentication is immediate - no redirect needed
22 print(f"Successfully connected Zenrows for user {user_id}")
23 print(f"Connection status: {connection_request.status}")
24
25 return connection_request.id
26
27
28connection_id = authenticate_toolkit(user_id, zenrows_auth_config_id)
29
30# You can verify the connection using:
31connected_account = composio.connected_accounts.get(connection_id)
32print(f"Connected account: {connected_account}")

Tools

Executing tools

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["ZENROWS"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Get ZenRows API Usage Statistics

Description

This tool retrieves the current api usage statistics and limits for your zenrows account. it is an independent action that requires no additional parameters besides authentication. it is useful for monitoring api usage and ensuring that the account has sufficient remaining credits.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Concurrency Status

Description

This tool retrieves the current concurrency status of your zenrows api usage. it reports the maximum number of concurrent requests allowed by your plan and the number of available concurrent request slots. it is useful for monitoring api usage, implementing rate limiting, debugging request issues, and capacity planning.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Detailed Concurrency Status

Description

This tool provides detailed information about the current concurrency status and limits of your zenrows account by making a request to the api and analyzing the response headers. it is essential for monitoring real-time api usage, managing concurrent requests, and ensuring optimal performance within plan limits.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Original Status Code

Description

This tool retrieves the original http status code returned by the target website, which is useful for debugging purposes. it returns the original status code in the response headers under 'x-zenrows-original-status'. it can also provide the full response body and error messages, helping with debugging scraping issues, verifying website responses, monitoring availability, and understanding website behavior.

Action Parameters

url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get PDF from URL

Description

This tool generates a pdf version of the scraped content from a given url. it requires javascript rendering to be enabled and sets the response type to pdf, making it ideal for archiving web pages, creating documentation, generating reports, or saving articles for offline reading.

Action Parameters

premium_proxy
boolean
url
stringRequired
wait
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Plaintext Response

Description

This tool extracts plain text content from a webpage using the zenrows api. by using the response type=plaintext parameter, it strips html tags and formats the content into clean, plain text. it's useful for extracting readable content for nlp, summarization, or archiving purposes.

Action Parameters

js_render
boolean
premium_proxy
boolean
url
stringRequired
wait
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Response with Compression

Description

A tool to fetch content from a url using the zenrows api with compression enabled to optimize bandwidth usage and improve performance. it supports gzip, deflate, and br compression encodings, handles decompression automatically, and provides compression statistics along with the decompressed content.

Action Parameters

custom_headers
object
url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get response headers

Description

A tool to retrieve and parse response headers from zenrows api requests. it provides critical metadata such as concurrency limits, available request slots, request cost, unique request id, and final url after redirects, which is essential for monitoring usage, debugging, and optimizing requests.

Action Parameters

url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Session ID

Description

This tool implements zenrows' session management functionality to maintain the same ip address across multiple requests for up to 10 minutes. it supports parameters like url, session id, and premium proxy, and is useful for maintaining consistent scraping sessions, simulating real user behavior, and avoiding detection by anti-bot systems.

Action Parameters

premium_proxy
boolean
session_id
integerRequired
url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Walmart Product Details

Description

This tool allows users to extract detailed product information from walmart using zenrows' specialized e-commerce scraping api. it provides structured data for walmart products including product details, pricing, availability, and more.

Action Parameters

js_render
booleanDefaults to True
url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Scrape url autoparse

Description

The zenrows scrape url autoparse tool automatically parses and extracts structured data from any given url using intelligent parsing capabilities. it eliminates the need for manual css selectors by auto-identifying relevant content on web pages, returning data such as titles, main content, meta descriptions, images, links, prices, and contact information in a structured json format.

Action Parameters

js_render
booleanDefaults to True
premium_proxy
booleanDefaults to True
url
stringRequired
wait
integerDefaults to 5

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Scrape URL HTML

Description

This tool extracts raw html data from a given url using zenrows' universal scraper api. it focuses on retrieving the pure html content of the webpage without automatic parsing or data extraction. it supports parameters such as js render for enabling javascript rendering, custom headers for custom http headers, premium proxy for using premium proxies, and session id for maintaining the same ip across multiple requests.

Action Parameters

custom_headers
object
js_render
boolean
original_status
boolean
premium_proxy
boolean
proxy_country
string
session_id
string
url
stringRequired
wait
integer
wait_for
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Scrape URL with CSS Selectors

Description

This tool allows users to scrape specific elements from a webpage using css selectors. it is particularly useful for targeted data extraction rather than retrieving the entire page content. the endpoint takes a url and a json object containing css selectors for parsing elements such as titles, links, images, and prices, and includes optional parameters like using premium proxies, specifying response wait times, and custom headers among others.

Action Parameters

css_selectors
objectRequired
js_render
boolean
premium_proxy
boolean
url
stringRequired
wait
integer
wait_for
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Screenshot URL

Description

A tool to capture screenshots of web pages using zenrows api. this tool allows you to take screenshots of entire web pages or specific elements, with customizable options for format and quality.

Action Parameters

screenshot_format
stringDefaults to png
screenshot_fullpage
boolean
screenshot_quality
integer
screenshot_selector
string
url
stringRequired
wait
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Real Estate Property Data

Description

A specialized tool for extracting structured data from real estate platforms like zillow and idealista. it leverages zenrows' real estate api to fetch comprehensive property information, including property details, location information, features, seller details, and more, in a structured format.

Action Parameters

country
string
language
string
platform
stringRequired
property_id
stringRequired
tld
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Scrape url

Description

Scrape and extract data from a specified url. this action allows you to collect and process web data effortlessly using the zenrows api.

Action Parameters

url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired