Lexbase Search API

The Search API from Lexbase — 1 operation(s) for search.

GitHub OpenAPI

Operations 1

GET /search Semantic + lexical search over consolidated legislation #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/lexbase-pt:lexbase-pt-search-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

lexbase-pt-search-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Lexbase API — legislação portuguesa consolidada Search API
  version: 1.0.0
  description: Read-only HTTP API over Portuguese consolidated legislation. Every content response carries a verifiable citation (diploma + article) and its in-force status. The same corpus is exposed as an MCP server at https://api.lexbase.pt/mcp. Legal information — not legal advice.
  contact:
    name: Lexbase
    url: https://lexbase.pt
servers:
- url: https://api.lexbase.pt
  description: Production
security:
- bearerAuth: []
tags:
- name: Search
paths:
  /search:
    get:
      summary: Semantic + lexical search over consolidated legislation
      parameters:
      - name: q
        in: query
        required: true
        schema:
          type: string
        description: Natural-language query in Portuguese.
      - name: k
        in: query
        schema:
          type: integer
          default: 8
        description: Number of results.
      - name: tipo
        in: query
        schema:
          type: string
        description: Filter by diploma type (Lei, Decreto-Lei, …).
      - name: tema_tag_id
        in: query
        schema:
          type: string
        description: Filter by legal theme (see /themes).
      - name: in_force_only
        in: query
        schema:
          type: boolean
          default: true
        description: Restrict to wording currently in force.
      responses:
        '200':
          description: Ranked articles. Each hit carries a verifiable citation, the article text, and the matched snippet. total=0 with a note means an honest no-match.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '401':
          description: Missing/invalid key
        '429':
          description: Quota or rate limit exceeded
      tags:
      - Search
      operationId: getSearch
      x-operation-id-source: derived
components:
  schemas:
    SearchResponse:
      type: object
      properties:
        query:
          type: string
        total:
          type: integer
        note:
          type: string
          description: Present when total=0 — why nothing matched.
        hits:
          type: array
          items:
            type: object
            properties:
              fragment_id:
                type: string
              citation:
                type: string
                description: 'Verifiable citation: diploma + article.'
              texto:
                type: string
              in_force:
                type: boolean
              url:
                type: string
                description: Permalink into lexbase.pt with the article highlighted.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A Lexbase API key (lx_… / leis_…) in the Authorization header. Create one at https://lexbase.pt/mcp.