Skip to main content

Download a raw file

Records from Intelligence Search and Identity Portal have a system_id. Pass it to the System ID module to get the file. Each download is a search and uses 1 request.
If a record has system_id: null, it has no downloadable file. Storage ID works the same way with a storage_id and a bucket; its response has storage_id and bucket instead of system_id. See Modules and inputs.

Large files

  • At most the first 8 MB of a file are delivered. file.truncated is then true and bytes is the size delivered.
  • total_bytes is the size of the whole file, or null if the file was over 16 MB and could not be measured.
  • A file known to be over 16 MB before it is read is refused with 502 upstream_error, refunded.
  • A file that is empty (or only whitespace) returns file: null. It is billed, except when the file was not found, which is refunded. Check billed.

?format=txt

Add ?format=txt to get plain text instead of JSON. It is the same call and the same price: nothing extra is billed. A text response is a text/plain; charset=utf-8 attachment. The billing and quota headers are the same as for JSON, since there is no body to carry billed:
File names only contain A-Z a-z 0-9 . _ -, so curl -OJ is safe to use.

Empty results

With ?format=txt, an empty result returns 204 No Content with no body. Read X-Request-Billed to know whether it was billed.

Errors stay JSON

?format=txt only changes successful output. Errors are always the JSON envelope described in Errors. Check the status code before saving the body to a file:
File content comes from leaked data. Treat it as untrusted text: never execute it or render it as HTML.