Overview
The BR-ACC API is a Brazilian public data graph analysis tool built with FastAPI. It provides programmatic access to entity search, graph analysis, investigation tracking, and pattern detection across Brazilian public datasets. API Version: 0.1.0Base URL
The API is typically deployed at:/api/v1 (e.g., /api/v1/search).
Rate Limiting
The BR-ACC API implements rate limiting to ensure fair usage and system stability. Rate limits are applied per user (for authenticated requests) or per IP address (for anonymous requests).Rate Limit Tiers
Unauthenticated requests are limited to 60 requests per minute per IP address.
Authenticated requests are limited to 300 requests per minute per user.
Endpoint-Specific Limits
Some endpoints have stricter rate limits:- Authentication endpoints (
/api/v1/auth/register,/api/v1/auth/login): 10/minute - Search endpoints (
/api/v1/search): 30/minute - Pattern detection endpoints (
/api/v1/patterns/*): 30/minute
Rate Limit Response
When you exceed the rate limit, you’ll receive a429 Too Many Requests response:
Rate Limit Headers
The API includes standard rate limit headers in responses:X-RateLimit-Limit: The maximum number of requests allowedX-RateLimit-Remaining: The number of requests remaining in the current windowX-RateLimit-Reset: The time when the rate limit resets (Unix timestamp)
Pagination
Many list endpoints support pagination usingpage and size query parameters.
Pagination Parameters
Page number (1-indexed). Must be >= 1.
Number of results per page. Must be between 1 and 100.
Pagination Response Format
Endpoints that support pagination return responses with the following structure:Array of result objects for the current page.
Total number of results available across all pages.
Current page number.
Number of results per page.
Example Paginated Request
Cursor-Based Pagination
Some endpoints (like entity events) use cursor-based pagination for efficient traversal of time-series data:Cursor for the next page of results (returned in previous response).
Maximum number of results to return (1-100).
next_cursor field:
next_cursor value as the cursor parameter in the next request to continue pagination.
Health Check
The API provides a health check endpoint to verify service availability:CORS Configuration
The API supports Cross-Origin Resource Sharing (CORS) with configurable allowed origins. By default, the API allows requests fromhttp://localhost:3000.
CORS is configured to allow:
- Credentials (cookies, authorization headers)
- All HTTP methods
- All headers
Security Headers
The BR-ACC API implements security best practices including:- Security Headers Middleware: Adds security headers to all responses
- CPF Masking Middleware: Automatically masks sensitive Brazilian CPF numbers in responses
- HTTPS: Secure cookies are enforced in production environments
Error Handling
The API uses standard HTTP status codes:200 OK: Successful request201 Created: Resource successfully created204 No Content: Successful request with no response body400 Bad Request: Invalid request parameters401 Unauthorized: Authentication required or invalid credentials403 Forbidden: Authenticated but insufficient permissions404 Not Found: Resource not found409 Conflict: Resource conflict (e.g., email already registered)429 Too Many Requests: Rate limit exceeded500 Internal Server Error: Server error
detail field with a description:
Next Steps
Authentication
Learn how to register and authenticate users
Search Entities
Search for entities in the Brazilian public data graph