Parallel Python SDK
The official Python library for interacting with the Parallel API. It provides programmatic access to Parallel's web data extraction and search capabilities. The library maintains an active development pace with frequent updates, typically on a monthly or bi-monthly schedule, reflecting continuous API enhancements.
Warnings
- breaking Version `0.3.0` contains a critical bug in parameter handling and should not be used. It can lead to incorrect API requests or unexpected errors.
- gotcha The library frequently updates to support beta API endpoints (e.g., `/v1beta/search`, `/v1beta/extract`). While default beta headers are often handled, the behavior and stability of these endpoints may change rapidly. Features like `search` and `extract` have seen multiple beta iterations.
- gotcha The nomenclature for `findAll` methods was updated in `v0.4.0`. If your application uses `findAll` pattern methods, they may need to be adjusted or renamed to align with the new API structure.
- gotcha Early versions of the library (prior to `v0.3.4`) may experience compatibility issues with Python 3.14.
Install
-
pip install parallel-web
Imports
- Parallel
from parallel import Parallel
Quickstart
import os
from parallel import Parallel
# Ensure PARALLEL_API_KEY is set in your environment variables
api_key = os.environ.get('PARALLEL_API_KEY', '')
if not api_key:
print("Error: PARALLEL_API_KEY environment variable not set.")
else:
try:
client = Parallel(api_key=api_key)
response = client.search.run(query="latest news in AI")
print(response.json())
except Exception as e:
print(f"An error occurred: {e}")