datasets

Stream the latest version of a resource as a forced download

See LEDG-1765. Replaces the previous 302 redirect, which let the browser render the file inline (PDFs, images, HTML, etc.) and ignored cross-origin download attributes. Both code paths emit Content-Disposition: attachment so the browser always saves the file to disk.

  • Hosted resources (fs_filename set) are streamed from the storage backend via send_file(as_attachment=True).
  • OGC services (WMS/WFS) keep the pre-LEDG-1765 302 redirect — see _is_ogc_service.
  • Other remote resources are pulled through the SSRF-guarded download proxy (LEDG-1214), reusing stream_as_attachment.

The endpoint URL is unchanged, so the permanent latest link of a resource keeps working for harvesters and external integrations.

get/datasets/r/{id}

Request

  • Base URL
    https://dados.gov.pt/api/1
  • URL
    https://dados.gov.pt/api/1/datasets/r/{id}
  • Auth
    none declared

Query parameters

datasetstring

The dataset ID or slug

Response

Success

Changes

No recorded changes to this operation across all 21 revisions of this API.