cdep APIcdep.ro ↗
Access Romanian legislative initiatives via the cdep.ro API. List bills by year and chamber, retrieve sponsors, status, summaries, and introduction dates.
What is the cdep API?
The cdep.ro API exposes Romanian Chamber of Deputies legislative data through 2 endpoints, covering both bill listings and detailed initiative records. Use list_initiatives to retrieve all proposals registered in a given year for either the Senate or Chamber of Deputies, and get_initiative_details to pull structured fields like title, status, sponsors, and date introduced for any specific bill identified by its idp parameter.
curl -X GET 'https://api.parse.bot/scraper/00f13c84-43c8-4cec-a51d-93e445c77769/list_initiatives' \ -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 cdep-ro-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.
"""
Romanian Parliament (cdep.ro) Legislative Initiatives Scraper
Get your API key from: https://parse.bot/settings
"""
import os
import requests
from typing import Optional
class ParseClient:
"""Client for the Romanian Parliament (cdep.ro) legislative initiatives API."""
def __init__(self, api_key: Optional[str] = None):
"""Initialize the Parse API client."""
self.base_url = "https://api.parse.bot"
self.scraper_id = "505f50bc-e7ef-4ed8-a049-c23e3e1e5387"
self.api_key = api_key or os.getenv("PARSE_API_KEY")
if not self.api_key:
raise ValueError("API key not provided. Set PARSE_API_KEY environment variable.")
def _call(self, endpoint: str, method: str = "POST", **params) -> dict:
"""
Call a Parse API endpoint.
Args:
endpoint: The API endpoint name
method: HTTP method (GET or POST)
**params: Query or body parameters
Returns:
JSON response as dictionary
"""
url = f"{self.base_url}/scraper/{self.scraper_id}/{endpoint}"
headers = {
"X-API-Key": self.api_key,
"Content-Type": "application/json"
}
if method == "GET":
response = requests.get(url, headers=headers, params=params)
elif method == "POST":
response = requests.post(url, headers=headers, json=params)
else:
raise ValueError(f"Unsupported HTTP method: {method}")
response.raise_for_status()
return response.json()
def list_initiatives(self, chamber: Optional[str] = None, year: Optional[str] = None) -> dict:
"""
List legislative initiatives for a specific year and chamber.
Args:
chamber: Legislative chamber (1 = Senate, 2 = Chamber of Deputies). Default: 2
year: Year of registration. Default: 2024
Returns:
Dictionary with initiatives list
"""
params = {}
if chamber is not None:
params["chamber"] = chamber
if year is not None:
params["year"] = year
return self._call("list_initiatives", method="GET", **params)
def get_initiative_details(self, idp: str) -> dict:
"""
Get detailed information for a specific legislative initiative.
Args:
idp: Internal identifier of the project
Returns:
Dictionary with initiative details
"""
return self._call("get_initiative_details", method="GET", idp=idp)
def main():
"""Demonstrate a practical workflow with the Romanian Parliament API."""
client = ParseClient()
print("=" * 80)
print("Romanian Parliament Legislative Initiatives Scraper")
print("=" * 80)
# Step 1: List initiatives from 2024 (Chamber of Deputies, default)
print("\n1. Fetching legislative initiatives from 2024...")
initiatives_response = client.list_initiatives(year="2024", chamber="2")
year = initiatives_response.get("year", "2024")
total_count = initiatives_response.get("count", 0)
initiatives = initiatives_response.get("initiatives", [])
print(f" Found {total_count} initiative(s) from {year}")
if not initiatives:
print(" No initiatives found.")
return
# Step 2: Process each initiative
print(f"\n2. Processing {min(3, len(initiatives))} initiatives (showing first 3)...")
for i, initiative in enumerate(initiatives[:3], 1):
idp = initiative.get("idp")
title = initiative.get("title", "N/A")
status = initiative.get("status", "N/A")
date_intro = initiative.get("date_introduced", "N/A")
reg_num = initiative.get("registration_number", "N/A")
print(f"\n Initiative {i}:")
print(f" - ID: {idp}")
print(f" - Title: {title}")
print(f" - Registration #: {reg_num}")
print(f" - Introduced: {date_intro}")
print(f" - Status: {status}")
# Step 3: Get detailed information for each initiative
if idp:
try:
print(f" - Fetching details...")
details = client.get_initiative_details(idp=idp)
sponsors = details.get("sponsors", [])
summary = details.get("summary", "N/A")
url = details.get("url", "N/A")
detail_status = details.get("status", status)
print(f" Sponsors: {', '.join(sponsors) if sponsors else 'None listed'}")
print(f" URL: {url}")
print(f" Summary: {summary[:100]}..." if len(summary) > 100 else f" Summary: {summary}")
except Exception as e:
print(f" Error fetching details: {str(e)}")
# Summary
print("\n" + "=" * 80)
print(f"Summary: Successfully retrieved {min(3, len(initiatives))} initiatives from {year}")
print("=" * 80)
if __name__ == "__main__":
main()List legislative initiatives for a specific year and chamber.
| Param | Type | Description |
|---|---|---|
| year | string | Year of registration |
| chamber | string | Legislative chamber (1 = Senate, 2 = Chamber of Deputies) |
{
"type": "object",
"fields": {
"year": "string",
"count": "integer",
"initiatives": "array"
},
"sample": {
"year": "2024",
"count": 1,
"initiatives": [
{
"idp": "22238",
"title": "Proiect de Lege pentru modificarea şi completarea Legii nr.227/2015 privind Codul fiscal",
"status": "în lucru la comisiile permanente ale Camerei Deputaţilor",
"date_introduced": "15.01.2024",
"registration_number": "PL-x 1/2024"
}
]
}
}About the cdep API
What the API Covers
The cdep.ro API gives programmatic access to legislative initiatives published on the official Romanian Chamber of Deputies website. The list_initiatives endpoint accepts a year and a chamber parameter — 1 for the Senate, 2 for the Chamber of Deputies — and returns the total count of matched proposals alongside an initiatives array for that session. This lets you build year-over-year comparisons or monitor legislative activity across both chambers.
Initiative Detail Records
Once you have an idp identifier from the list endpoint, pass it to get_initiative_details to retrieve a full record. The response includes the bill's title, current status, a human-readable summary, the date_introduced, a sponsors array listing the individuals or groups who introduced the bill, and a direct url back to the official cdep.ro page. These fields are sufficient to track a bill's lifecycle from introduction through its current parliamentary state.
Reliability Notes
The cdep.ro site periodically experiences availability issues. The API includes retry logic so transient outages at the source do not immediately surface as errors to your application. Responses reflect the data as currently published on the official site; the API does not maintain a separate historical archive beyond what cdep.ro itself exposes.
The cdep API is a managed, monitored endpoint for cdep.ro — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when cdep.ro 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 cdep.ro 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 which sponsors have introduced the most bills in a given parliamentary year using the
sponsorsfield. - Build a legislative calendar by querying
list_initiativesfor each year and sorting bydate_introduced. - Monitor status changes on specific bills by polling
get_initiative_detailswith storedidpvalues. - Compare legislative volume between the Senate and Chamber of Deputies using the
chamberparameter andcountfield. - Aggregate bill summaries for legal research or policy analysis by collecting the
summaryfield across many initiatives. - Generate citation links to official cdep.ro bill pages using the
urlfield returned byget_initiative_details. - Filter active versus historical proposals by combining
yearfiltering with thestatusfield.
| 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 cdep.ro have an official developer API?+
What does the `chamber` parameter control in `list_initiatives`?+
1 to scope results to Senate-registered initiatives and 2 for those registered in the Chamber of Deputies. Omitting the parameter returns initiatives without chamber filtering, depending on the site's default behavior. The response always includes the matched count and the full initiatives array for that selection.Does the API return the full text or PDF of a bill?+
title, status, summary, sponsors, date_introduced, and a url — but not the raw legislative text or attached document files. The url field points to the official cdep.ro page where documents are typically linked. You can fork this API on Parse and revise it to add an endpoint that fetches and returns linked document content.How current is the data returned by `get_initiative_details`?+
status and other fields reflect what is currently published on the cdep.ro website at the time of the request. The API does not cache or store historical snapshots, so if cdep.ro updates a bill's status, subsequent calls will return the updated value. During source-site outages, the retry logic attempts to resolve the request but cannot serve data that the site itself is not delivering.