Datasette JSON Extractor avatar

Datasette JSON Extractor

Pricing

from $0.35 / 1,000 record extracteds

Go to Apify Store
Datasette JSON Extractor

Datasette JSON Extractor

Point at ANY Datasette instance and pull structured data via its uniform JSON API. Discover every database + table, page a table's rows into a clean dataset, or run a read-only SQL query. Works on any datasette publish site with no per-site scraper. Pay per record.

Pricing

from $0.35 / 1,000 record extracteds

Rating

0.0

(0)

Developer

Datamule

Datamule

Maintained by Community

Actor stats

0

Bookmarked

3

Total users

1

Monthly active users

2 months ago

Last modified

Categories

Share

Extract a bounded dataset from any public or authorized Datasette instance: discover databases and tables, page table rows, or run a read-only SQL query through Datasette's JSON API.

Try it now

Run this exact input against Datasette's public reference instance. It reads at most 25 genuine rows from a table with a compound primary key.

{"baseUrl":"https://latest.datasette.io","database":"fixtures","table":"compound_three_primary_keys","listDatabasesOnly":false,"maxRecords":25,"pageSize":25}

Example output

The first genuine source row is:

{"content":"a-a-a","pk1":"a","pk2":"a","pk3":"a"}

The Actor preserves its source identity, spreads the table columns, builds the compound key, and keeps the original row losslessly in raw:

{
"_source": "https://latest.datasette.io",
"_database": "fixtures",
"_table": "compound_three_primary_keys",
"_mode": "row",
"_rowIndex": 0,
"primaryKey": "a,a,a",
"pk1": "a",
"pk2": "a",
"pk3": "a",
"content": "a-a-a",
"raw": {"content":"a-a-a","pk1":"a","pk2":"a","pk3":"a"}
}

Pricing

The active pay-per-event price is $0.0005 per record. A record is one emitted table in discovery mode or one emitted row in rows/SQL mode. The try-now input can emit no more than 25 records, so its event-charge ceiling is 25 × $0.0005 = $0.0125. This ceiling excludes Apify infrastructure usage.

Inputs and modes

The mode is selected from the input:

  • Discovery: omit table and sql to emit one record per database/table pair.
  • Rows: set database and table to page that table until it ends or maxRecords is reached.
  • SQL: set sql to use Datasette's read-only SQL API. SQL takes precedence over table.
FieldDescription
baseUrl (required)Datasette instance root, such as https://latest.datasette.io. Do not include /-/databases.json. Path-mounted instances work, and the Actor can recover the root when given a database or table URL.
databaseDatabase name. Leave empty for discovery; rows/SQL mode can infer it only when the instance exposes one non-memory database.
tableExact table or view name. Setting it selects rows mode.
sqlOptional read-only SQL query; takes precedence over table.
listDatabasesOnlyDiscovery switch. The default is false; discovery is still selected when both table and sql are empty.
maxRecordsTotal output cap across every mode. Default: 25. Minimum: 1.
pageSizeRows requested per page in rows mode. Default: 25; maximum: 1000; the source server may impose a lower cap.
bearerTokenOptional bearer token for an authorized private instance. It is never logged.
extraHeadersOptional JSON object of request headers, such as an API-gateway key. Header values are never logged.

Output field dictionary

FieldMeaning
_sourceResolved Datasette instance root used for the request.
_databaseSource database name.
_tableSource table/view name, or null for SQL output.
_modetable for discovery, row for table rows, or sql for query results.
_rowIndexZero-based emitted-row index for rows/SQL output; null in discovery.
primaryKeyComma-joined declared primary-key values when available.
rawLossless original source object.
databaseName, tableNameDiscovery identity fields.
rowCount, columns, primaryKeys, isViewDiscovery metadata reported by Datasette.
tableUrl, databaseUrlDirect source links on discovery records.
Source columnsRows/SQL fields are also spread to top-level keys. A collision with an Actor-managed key is renamed with a field_ prefix.

Recurring agent use cases

  • Let a research agent collect a small repeatable slice of a public Datasette table for comparison or monitoring.
  • Let a coding or data agent discover databases, table names, columns, and keys before choosing an extraction target.
  • Feed civic, archival, or research workflows with bounded rows from deployments that expose the standard Datasette API.
  • Query an owned Datasette deployment from a personal agent by supplying its authorized bearer token or gateway headers.

Coverage, freshness, and limits

  • The Actor targets standard Datasette JSON endpoints. It does not parse arbitrary websites or bypass a deployment's authentication and authorization rules.
  • Data is fetched at run time and is only as fresh and complete as the upstream Datasette instance. The Actor does not maintain its own snapshot or cache.
  • Cursor paging is not a transactional snapshot: rows can change if the upstream table is modified during a run.
  • maxRecords bounds emitted and billable records. Datasette may apply its own page-size, query, timeout, visibility, or SQL restrictions.
  • Empty source tables and zero-row SQL results produce zero records; the Actor does not fabricate fallback data.
  • Use only instances and data you are authorized to access, and follow the source's terms and applicable data rules.

Troubleshooting

  • Bad root URL / /-/databases.json not found: provide the instance root, not the JSON endpoint. For a path-mounted deployment, include its mount prefix. The Actor can strip a pasted database/table suffix, but it cannot infer an unrelated proxy path.
  • HTML or non-JSON response: the URL is probably a website page, sign-in page, or proxy error rather than a Datasette JSON root. Open <baseUrl>/-/databases.json and confirm it returns JSON.
  • 401 or 403 authentication error: supply an authorized bearerToken or the required extraHeaders. The Actor does not obtain credentials or bypass access controls.
  • Database missing: run discovery first and copy the exact database name. On multi-database instances, rows and SQL modes require an explicit database.
  • Table missing: copy the exact table/view name from discovery, including spaces and punctuation, and verify it belongs to the selected database.
  • Empty results: confirm that the table has rows or that the SQL filter matches data. A valid empty response exits cleanly with zero output records.
  • SQL error: verify the selected database, table and column names, and use SQL supported by that deployment. Some instances restrict or disable custom SQL; the source error is surfaced rather than replaced with data.