Skip to main content

pageindex-search

Python client for Page Search API by PageIndex. Upload a PDF, ask up to 10 questions at once, and get back the pages that answer each one, ranked by relevance. Every page is read.

pip install pageindex-search

Create an API key in the console and set it:

export PAGEINDEX_SEARCH_API_KEY=pis_live_...

Quick start

from pageindex_search import PageSearch

client = PageSearch()

doc = client.upload("3M_2018_10K.pdf")
result = client.search(doc, ["What was capital expenditure in 2018?", "Who is the CEO?"])

for answer in result.results:
    print(answer.question)
    for page in answer.pages:
        print(f"  page {page.page}: {page.relevance:.2f}")

print(f"cost ${result.usage.cost_usd}, credit left ${result.usage.balance_usd}")

Upload a document once and search it as often as you like; uploading the same file again returns the same document.

Reference

PageSearch(api_key=None, base_url=None, timeout=120, max_retries=2) The key defaults to PAGEINDEX_SEARCH_API_KEY.
upload(file, wait=True) A path, bytes or an open file. Returns a Document, ready to search unless wait=False.
search(document, questions, top_k=None, idempotency_key=None) Up to 10 questions. Each answer lists the pages likely to help (relevance 0.3 or more; 0.2 or more when fewer than 3 are; possibly none), or exactly top_k. A search retried after a timeout is not charged twice.
document(id), documents(limit, after), iter_documents() Your documents.
delete(document) Delete a document.
usage(start=None, end=None) Uploads, searches and cost by day, your credit and stored pages.

Errors raise PageSearchError, with the API's status, code, message and request_id.

See the API reference for every field and the pricing.

Metadata

Release files for pageindex-search 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pageindex-search 0.1.2
File Size Uploaded Provenance Actions
pageindex_search-0.1.2.tar.gz 7.4 kB Without provenance Details for pageindex_search-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pageindex-search 0.1.2
File Interpreter ABI Platform Actions
pageindex_search-0.1.2-py3-none-any.whl Python 3 none any Details for pageindex_search-0.1.2-py3-none-any.whl

Total release size: 15.0 kB

Release files / pageindex_search-0.1.2.tar.gz

Download URL pageindex_search-0.1.2.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8d6492b2d7687756a60a1ea6c556396fbe3c5468b6db22811dd6489aaac7f97f
BLAKE2b-256 checksum
How to use checksums
b0aa7c94ee43580ff358f64a07f6d5536550da929bc21d5df0b5cec1b26afd54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pageindex_search-0.1.2-py3-none-any.whl

Download URL pageindex_search-0.1.2-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66d315ef406a1867483074ee3b49217674671c5ace9e49bc28dc340fd2e7cfdc
BLAKE2b-256 checksum
How to use checksums
6f91a6a3cba0d6962ee507fecaf9df5f2d643f58f45ec7f08fab7f14e9fc21f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pageindex-search 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page