Bs APIcomune.sirmione.bs.it ↗
Retrieve attachments from public-document pages on the Comune di Sirmione website, including PDF links, file types, and page metadata via one endpoint.
What is the Bs API?
The Comune di Sirmione API exposes 1 endpoint — get_document_attachments — that returns structured metadata from public-document pages on the municipality's official site. A single call resolves the page title, subtitle, and a full array of attachment objects (title, href, and file extension) for any documenti_pubblici page, such as the taxi tariff schedule. The response also includes the canonical page URL and a total attachment count.
curl -X GET 'https://api.parse.bot/scraper/66776845-64a1-415a-99b2-e67111809ec7/get_document_attachments?slug=revisione-tariffe-autonoleggio-da-piazza-del-comune-di-sirmione' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace comune-sirmione-bs-it-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Comune di Sirmione public-document attachments."""
from parse_apis.comune_sirmione_bs_it_api import ComuneSirmione, DocumentNotFound
client = ComuneSirmione()
# Fetch the taxi-tariff revision page (default slug) and list its attachments.
doc = client.documents.get()
print(doc.title)
if doc.subtitle:
print(doc.subtitle)
print(f"{doc.attachment_count} attachment(s) on {doc.page_url}")
if doc.attachments:
for att in doc.attachments:
print(f" {att.title} ({att.file_type}): {att.href}")
# Point lookup by explicit slug, with error handling for unknown pages.
try:
other = client.documents.get(slug="documento-inesistente-xyz")
except DocumentNotFound:
print("Document not found — slug does not match any published page")
print("exercised: documents.get / DocumentNotFound")
Returns the attachments listed in the 'Documenti' section of one public-document page (documenti_pubblici) on the Comune di Sirmione site, identified by its URL slug. Each attachment carries the display title and the actual file href exactly as linked on the page (files are hosted on the municipality's document storage), plus the file extension. One page fetch per call; no pagination. When the slug is omitted the taxi tariff revision page is used, whose single attachment is the 'Tariffario TAXI' PDF. An unknown slug returns a stale_input (input_not_found) error; a page without a Documenti section returns extraction_failed.
| Param | Type | Description |
|---|---|---|
| slug | string | URL slug of the public-document page (the last path segment of /it/documenti_pubblici/<slug>), lowercase letters, digits, hyphens or underscores. |
{
"type": "object",
"fields": {
"slug": "slug of the document page that was fetched",
"title": "document page title",
"page_url": "full URL of the document page",
"subtitle": "short description shown under the title; null when absent",
"attachments": "array of attachment objects: title (link text), href (actual file link as published), file_type (lowercase extension, null when none)",
"attachment_count": "integer number of attachments found"
},
"sample": {
"data": {
"slug": "revisione-tariffe-autonoleggio-da-piazza-del-comune-di-sirmione",
"title": "Revisione tariffe autonoleggio da piazza del comune di Sirmione",
"page_url": "https://www.comune.sirmione.bs.it/it/documenti_pubblici/revisione-tariffe-autonoleggio-da-piazza-del-comune-di-sirmione",
"subtitle": "Elenco delle tariffe da applicarsi per il servizio non di linea effettuato a mezzo taxi",
"attachments": [
{
"href": "https://municipium-images-production.s3-eu-west-1.amazonaws.com/s3/6918/allegati/documenti/tariffario-taxi.pdf",
"title": "Tariffario TAXI",
"file_type": "pdf"
}
],
"attachment_count": 1
},
"status": "success"
}
}About the Bs API
What the API Returns
The get_document_attachments endpoint targets pages under the /it/documenti_pubblici/ path on the Comune di Sirmione website. Pass a slug string — the final path segment of the document page URL — and the API returns the page title, a subtitle (or null if none is published), the resolved page_url, and an attachments array. Each element in that array carries the link text (title), the direct file address (href), and a file_type field giving the lowercase extension (e.g. pdf), or null when no extension is detectable.
Attachment Details
The attachments array mirrors the contents of the 'Documenti' section on the source page exactly as published. If the municipality uploads a revised tariff PDF alongside an older version, both appear as separate objects. The integer attachment_count field tells you how many items were found without needing to measure the array yourself. File types beyond PDF — such as .docx or .xlsx — are surfaced the same way whenever the municipality publishes them.
Coverage Scope
The API is scoped to the documenti_pubblici section of comune.sirmione.bs.it. The primary documented use case is the taxi and hire-car tariff page (revisione-tariffe-autonoleggio-da-piazza-del-comune-di-sirmione), but any valid slug from that section of the site can be queried using the same slug parameter. Coverage depends on what documents the municipality has actually published on the page at the time of the request.
The Bs API is a managed, monitored endpoint for comune.sirmione.bs.it — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when comune.sirmione.bs.it changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official comune.sirmione.bs.it API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Monitor the Sirmione taxi tariff PDF for updates by checking the
hreffield on each new response and comparing it to the previous value. - Build a document archive that stores attachment
title,href, andfile_typerecords for multiple municipality public-document slugs. - Alert local transport operators when a new attachment appears on the hire-car tariff page by tracking changes in
attachment_count. - Aggregate public notices from Italian municipalities by parsing the
titleandsubtitlefields across multipledocumenti_pubblicipages. - Automate PDF download pipelines for local-government compliance records using the
hrefvalues returned in the attachments array. - Display a structured list of official Sirmione documents in a civic-information app, using
page_urlas the canonical reference link.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does the Comune di Sirmione website offer an official developer API?+
What does the `attachments` array include, and how are items distinguished?+
attachments carries three fields: title (the visible link text on the page), href (the direct file URL), and file_type (the lowercase file extension, or null when one cannot be inferred). Items map one-to-one with links in the 'Documenti' section; if multiple files are listed, all appear as separate objects.Can the API fetch document listings from other sections of the Comune di Sirmione site, such as news or council acts?+
/it/documenti_pubblici/ path only. You can fork it on Parse and revise it to add endpoints targeting other sections of the site.What happens if a `slug` points to a page with no attachments in the 'Documenti' section?+
title, subtitle, and page_url as normal. The attachments array will be empty and attachment_count will be 0.