The Law4Devs API is fully described in an OpenAPI 3.0.3 specification. You can use
this to import the API into your preferred HTTP client, generate typed SDK code, or
run automated contract tests.
Access the Spec
| Format | URL |
|---|
| JSON | https://api.law4devs.eu/v1/openapi.json |
# Download the JSON spec
curl https://api.law4devs.eu/v1/openapi.json -o law4devs-openapi.json
Import into API Clients
- Open Postman and click Import
- Select Link and paste
https://api.law4devs.eu/v1/openapi.json
- Click Import — all endpoints appear as a new collection
- Set the
X-API-Key variable in the collection variables to your API key
- Click Create → Import from URL
- Paste
https://api.law4devs.eu/v1/openapi.json
- Click Fetch and Import
- Add
X-API-Key as a header in the collection settings
- In your collection, click … → Import
- Choose OpenAPI and paste the spec URL or upload the downloaded file
- Bruno generates requests for all endpoints automatically
Code Generation
Use openapi-generator to generate a typed client
in any language from the spec:
# Generate a Python client
openapi-generator generate \
-i https://api.law4devs.eu/v1/openapi.json \
-g python \
-o ./generated-client
# Generate a Go client
openapi-generator generate \
-i https://api.law4devs.eu/v1/openapi.json \
-g go \
-o ./generated-client
The official SDKs (Python, TypeScript, PHP) are hand-crafted and include features
like auto-pagination and retry logic that generated clients do not provide. Use
code generation only if your language isn’t covered by an official SDK.
Spec Details
| Property | Value |
|---|
| Spec version | OpenAPI 3.0.3 |
| API version | 1.0 |
| Total endpoints | 21 |
| Authentication | X-API-Key header |
| Response format | JSON |
| Pagination | Cursor-based with page and per_page |
Versioning
The current API version is 1.0. Every response includes the X-API-Version header
so your application can detect version changes programmatically. Breaking changes will
increment the major version and be announced in the Changelog.