elliotgao2/toapi

Every web site provides APIs.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 33 minutes ago
Added to GitGenius on September 19th, 2026
Created on November 27th, 2017
Open Issues & Pull Requests: 3 (+0)
GitHub issues: Enabled
Number of forks: 241
Total Stargazers: 3,555 (+0)
Total Subscribers: 72 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 2437.2 days
Mean response time: 1822.4 days
90th percentile: 2597.1 days
Tracked items: 7

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 0
New in 7 days: 0
Closed in 7 days: 0
Avg open age: N/A days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

toapi is a Python web scraping tool that turns any website into a JSON API through declarative configuration.

The tool solves the problem of extracting structured data from web pages without building custom crawlers or maintaining databases. It works by letting you declare which fields to extract using CSS selectors, then automatically fetches pages on demand, parses them, and serves the results as JSON. Pages and parsed results are cached in memory to avoid redundant work. For JavaScript-heavy sites, you can pass a headless browser path to handle dynamic content.

The project suits developers who need quick, lightweight APIs over existing websites without the overhead of traditional web scraping infrastructure. It works well for small to medium projects where on-demand parsing is acceptable and you control the source URLs. The declarative approach means you describe what data you want rather than writing scraping logic. You can map multiple source URLs to clean API paths using route parameters, merge data from several websites, and add custom cleaning methods to transform values before returning them.

The project maintains a clean development workflow using uv for packaging and ruff for linting and formatting, with pre-commit hooks enforcing both. Contributions are welcomed through pull requests, with a requirement to discuss non-trivial changes in an issue first and ensure tests and linting pass before submission.