-
Notifications
You must be signed in to change notification settings - Fork 4
Data preview service
David Megginson edited this page Mar 16, 2020
·
5 revisions
The HXL Proxy's Data-preview service at /api/data-preview.csv
and /api/data-preview.json
generates a raw (non-HXL-processed) preview of any tabular data source that the HXL Proxy can read. The service accepts the following GET parameters:
Parameter | Is required? | Description |
---|---|---|
url | yes | URL of the dataset to preview (must be publicly readable) |
sheet | no | The zero-based index of the sheet/tab to preview, if the source is an Excel workbook (defaults to 0 for the first sheet). Note that this does not apply to Google Sheets; use the full URL with the hash to get a specific tab |
filename | no | The download filename (defaults to data-preview.csv or data-preview.json) |
rows | no | The maximum number of rows to return (defaults to -1, for all) |
force | no | If the value is "on", skip caching (defaults to a one-hour cache for both input and output) |
The results include a CORS header to allow in-browser Javascript use.
To get a list of all the sheets in a Microsoft Excel workbook, use the Data preview sheets API endpoint.
Preview a Google Sheet, all rows, and return the results as JSON:
Same as the above, but with CSV output (UTF-8 character encoding):
JSON output, but limited to just the first 2 rows:
Learn more about the HXL standard at http://hxlstandard.org