Parallel Python SDK

0.4.2 · active · verified Sat Apr 11

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

Install

Imports

Quickstart

Initializes the Parallel client and performs a simple search query, printing the JSON response. Your `PARALLEL_API_KEY` must be set as an environment variable.

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}")

view raw JSON →