Diariodarepublica APIdiariodarepublica.pt ↗
Retrieve acts, decrees, and legislation from Portugal's Official Gazette via 3 endpoints. Access Serie I and Serie II publications by date.
What is the Diariodarepublica API?
The Diário da República API provides access to Portugal's Official Gazette through 3 endpoints, returning structured data on laws, decree-laws, resolutions, appointments, and administrative notices. The get_acts_by_date endpoint combines both publication series into a single response with per-series counts, while get_serie1_acts and get_serie2_acts let you query each series independently. Each act object includes fields like db_id, title, type, emitter, summary, and publication_date.
curl -X GET 'https://api.parse.bot/scraper/2fc3485c-f895-45a1-83b1-4998d1a47ab9/get_serie1_acts?date=2026-07-03' \ -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 diariodarepublica-pt-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: Diário da República SDK — retrieve Portuguese Official Gazette publications."""
from parse_apis.diário_da_república_api import DiarioRepublica, DateFormatInvalid
client = DiarioRepublica()
# Fetch Serie I primary legislation for a specific date
for act in client.serie1results.get_by_date(date="2024-12-02", limit=3):
print(act.title, act.type, act.emitter)
# Fetch Serie II administrative acts/diario issues
for act in client.serie2results.get_by_date(date="2024-12-02", limit=3):
print(act.title, act.serie)
# Get combined daily results from both series
result = client.dailyresults.get_by_date(date="2024-12-02", limit=1).first()
if result:
print(result.title, result.publication_date, result.serie)
# Typed error handling for invalid date format
try:
client.serie1results.get_by_date(date="not-a-date", limit=1).first()
except DateFormatInvalid as exc:
print(f"Invalid date: {exc}")
print("exercised: serie1results.get_by_date / serie2results.get_by_date / dailyresults.get_by_date")
Get all Serie I (1ª Série) acts published on a specific date. Serie I contains laws, decree-laws, resolutions, and other primary legislation. Returns the list of acts with metadata including type, emitter, summary, and associated Diário issue. Dates without publications return an empty acts array.
| Param | Type | Description |
|---|---|---|
| daterequired | string | Publication date in YYYY-MM-DD format. |
{
"type": "object",
"fields": {
"acts": "array of act objects with db_id, title, number, type, emitter, summary, publication_date, part, diario_title, diario_id, serie",
"date": "string - requested publication date",
"serie": "string - always 'I'",
"total_acts": "integer - number of acts found",
"total_diarios": "integer - number of Diário issues for the date"
},
"sample": {
"data": {
"acts": [
{
"part": "",
"type": "Lei",
"db_id": "898553932",
"serie": "I",
"title": "Lei n.º 43/2024",
"number": "43/2024",
"emitter": "Assembleia da República",
"summary": "Altera a Lei n.º 30/2021, de 21 de maio.",
"diario_id": "898553919",
"diario_title": "Diário da República n.º 233/2024, de 2 de dezembro de 2024",
"publication_date": "2024-12-02"
}
],
"date": "2024-12-02",
"serie": "I",
"total_acts": 4,
"total_diarios": 1
},
"status": "success"
}
}About the Diariodarepublica API
What the API Returns
All three endpoints are date-driven, accepting a date parameter in YYYY-MM-DD format. get_serie1_acts returns an array of act objects from Serie I (1ª Série), which covers primary legislation: laws, decree-laws, resolutions of the Council of Ministers, and similar instruments. Each act carries fields including number, type, emitter, summary, part, diario_title, diario_id, and serie. The response also surfaces total_acts and total_diarios counts for the requested date.
Serie II and Combined Queries
get_serie2_acts targets Serie II (2ª Série), which holds administrative acts, public appointments, procurement notices, and other secondary publications. The response includes a diarios array of issue-level metadata (each with db_id, title, date, and number) alongside any detailed act objects available for that date. For a full-day picture, get_acts_by_date merges both series, returning a unified acts array with serie1_count and serie2_count breakdown fields alongside total_acts.
Coverage and Data Shape
Publication dates follow the official Diário da República release calendar; not every calendar date has a corresponding issue. When no acts are published for a given date in a series, the relevant count fields return zero and the arrays are empty. The emitter field identifies the government body or entity responsible for each act, which is useful for filtering output by ministry or public authority.
The Diariodarepublica API is a managed, monitored endpoint for diariodarepublica.pt — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when diariodarepublica.pt 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 diariodarepublica.pt 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?+
- Track new legislation by polling
get_serie1_actsdaily and filtering bytypefor decree-laws or resolutions - Monitor public appointment notices in Serie II for a specific government body using the
emitterfield - Build a legislation alert system that flags acts from a specific ministry by matching
emitteracross dates - Aggregate a historical archive of Portuguese law by iterating
get_acts_by_dateacross a date range - Audit procurement and administrative notices by extracting
diariosmetadata fromget_serie2_acts - Compare legislative output volume over time using
serie1_countandserie2_countfromget_acts_by_date - Populate a legal research tool with act
summaryandtitlefields for full-text indexing
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Diário da República have an official developer API?+
What does `get_serie1_acts` return that `get_acts_by_date` does not?+
get_serie1_acts returns total_diarios — the number of distinct Diário issues published on that date for Serie I — which is not present in the combined get_acts_by_date response. It also keeps Serie I acts isolated, which is useful if you only need primary legislation and want to avoid processing Serie II noise.Can I search acts by keyword, emitter, or act type rather than by date?+
date parameter and return all acts for that date. Filtering by emitter, type, or keyword must be done client-side after fetching results. You can fork this API on Parse and revise it to add a search or filter endpoint targeting those fields.Are acts from dates before a certain year available?+
Does the API return the full text of each act?+
summary field and key metadata (title, number, type, emitter, diario_title), but not the complete legislative text. Full-text content is not currently exposed. You can fork this API on Parse and revise it to add an endpoint that retrieves the full body of a specific act by db_id.