service-public.fr APIservice-public.fr ↗
Access structured French government guides, administrative procedures, and legal references from service-public.fr via 3 API endpoints covering search, autocomplete, and Fiches Pratiques.
curl -X GET 'https://api.parse.bot/scraper/ea53a944-7aff-4f88-9cab-0d2d959bd911/get_suggestions?query=retraite' \ -H 'X-API-Key: $PARSE_API_KEY'
Get autocomplete suggestions and direct access links for a search term on service-public.fr.
| Param | Type | Description |
|---|---|---|
| queryrequired | string | Search term to get autocomplete suggestions for (e.g. 'retraite', 'logement') |
{
"type": "object",
"fields": {
"acces_direct": "object containing categorized direct access links (fiches_pratiques, slf, actualites)",
"autocomplete": "array of suggested search terms"
},
"sample": {
"data": {
"acces_direct": {
"slf": [
{
"url": "/particuliers/vosdroits/R60625",
"title": "Frais de justice applicables au règlement des petits litiges en Europe"
}
],
"actualites": [
{
"url": "/particuliers/actualites/A18404",
"title": "Affaires civiles - Simplifiez vos démarches civiles grâce à l'application justice.fr"
}
],
"fiches_pratiques": [
{
"url": "/particuliers/vosdroits/N261",
"title": "Accès au droit et à la justice"
}
]
},
"autocomplete": [
"justice",
"commissaire de justice",
"décision de justice"
]
},
"status": "success"
}
}About the service-public.fr API
The service-public.fr API exposes 3 endpoints for querying the official French public service portal: full-text search across practical guides and news, autocomplete suggestions with direct-access link bundles, and structured retrieval of any Fiche Pratique or category page by its ID. The get_fiche_by_id endpoint returns parsed sections, breadcrumb navigation, introductory text, and raw page content for guides covering topics from housing and retirement to civil status and taxation.
Search and Autocomplete
The search_site endpoint accepts a query string and an optional page integer for pagination. Each result object in the results array includes a title, url, and id — the last of which can be passed directly to get_fiche_by_id for structured content retrieval. The response also returns total_results_on_page so you can detect sparse result pages without an extra request.
The get_suggestions endpoint returns two structures for a given query: an autocomplete array of suggested search terms, and an acces_direct object that groups direct-access links into three categories — fiches_pratiques, slf (services en ligne et formulaires), and actualites (news). This is useful for building typeahead interfaces or surfacing the most relevant official resources for a given topic without a full search.
Structured Guide Retrieval
get_fiche_by_id accepts an id parameter following the portal's naming conventions: F prefix for individual practical guides (e.g. F32239), N for category/node pages (e.g. N31146), and R for resource references. The response includes title, intro, breadcrumb (as an array of navigation labels), sections (each with a title and content field, mirroring the accordion structure of the source page), and raw_text for full-text use cases. The url field gives the canonical page address for citation or linking.
Coverage Scope
The API covers all publicly accessible content on service-public.fr: practical guides for individuals, professionals, and associations; administrative procedure descriptions; legal text references; and news items. Content is in French, reflecting the source portal. IDs for specific guides are discoverable through search_site result objects or from the portal's own URL structure.
- Building a French administrative chatbot that retrieves structured Fiche Pratique sections by ID for accurate procedure answers
- Populating a typeahead search field with
get_suggestionsautocomplete terms and direct links for government topics - Indexing service-public.fr guides by crawling
search_siteresults page by page and fetching full content viaget_fiche_by_id - Extracting breadcrumb paths from guide responses to map the taxonomy of French administrative topics
- Monitoring updates to specific Fiches Pratiques by polling
get_fiche_by_idwith known IDs and comparingraw_textorsections - Surfacing relevant official French government resources within a legal-tech or HR compliance application using
search_sitequeries - Resolving administrative procedure details for a given topic by chaining
search_siteto retrieve IDs and thenget_fiche_by_idfor full structured content
| 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 | 250 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 service-public.fr have an official developer API?+
What does `get_fiche_by_id` return for a category page (N-prefix ID) versus an individual guide (F-prefix ID)?+
title, intro, breadcrumb, sections, raw_text, url, and id. Category pages (N-prefix) tend to have sections that list child guides rather than procedural steps, while individual guides (F-prefix) typically have accordion sections with detailed procedural or legal content. The breadcrumb array reflects the page's position in the site hierarchy in both cases.Does the API return content for pages that require a user account on service-public.fr?+
Can I filter search results by topic category or document type (e.g. only Fiches Pratiques for professionals)?+
search_site endpoint currently accepts a query string and a page number; there are no category, audience, or document-type filter parameters. Results mix guides, news, and services matching the query. You can fork the API on Parse and revise it to add filtering or faceted search capabilities against specific topic segments.Is there a way to list all available Fiche IDs without searching?+
search_site result objects or by knowing the ID from the portal's URL structure. You can fork the API on Parse and revise it to add a sitemap-traversal or category-crawl endpoint that enumerates guides systematically.