Skip to main content
Jarbas is the public-facing layer of Serenata de Amor. It takes the suspicion data produced by Rosie and makes it browsable for citizens, journalists, and developers through a web dashboard and a JSON API.

Web dashboard

Browse every reimbursement, filter by congressperson, party, state, or supplier, and see which claims Rosie flagged as suspicious.

REST API

Query reimbursement records, suspicion scores, subquotas, applicants, and company data programmatically.

Technology stack

Django 2.1

Python web framework powering the application server, ORM, admin interface, and management commands.

Django REST Framework 3.9

Provides the browsable JSON API with filtering, pagination, and permission classes.

PostgreSQL 9.6

The only supported database. Required for JSONField (suspicions), ArrayField (reimbursement numbers), and SearchVectorField (full-text search).

Celery 4 + RabbitMQ 3.7

Handles background tasks such as receipt URL fetching and scheduled search vector rebuilds. The tasks and beat containers run Celery workers.
The frontend dashboard is built with Elm and compiled to static assets served by Django. Static file serving in production uses WhiteNoise.

URL structure

PathPurpose
/Redirects to /dashboard/chamber_of_deputies/reimbursement/
/dashboard/Elm-powered web dashboard
/layers/Map layer data endpoints
/api/Core API endpoints
/api/chamber_of_deputies/Chamber of Deputies reimbursement API
/healthcheck/Application health check endpoint
/__debug__/Django Debug Toolbar (development only, when LOG_LEVEL=debug)

API resources

The Chamber of Deputies API exposes four main resources:
The primary resource. Each reimbursement is identified by its document_id. Endpoints:
  • GET /api/chamber_of_deputies/reimbursement/ — list all reimbursements with filtering
  • GET /api/chamber_of_deputies/reimbursement/<document_id>/ — retrieve one reimbursement
  • GET /api/chamber_of_deputies/reimbursement/<document_id>/receipt/ — fetch digitalized receipt URL
  • GET /api/chamber_of_deputies/reimbursement/<document_id>/same_day/ — list same-day expenses
Categories of expenses that can be reimbursed by congresspeople.
  • GET /api/chamber_of_deputies/subquota/ — list all subquota names and IDs
  • Filter with ?q= for a case-insensitive name search
The congressperson or party leadership who filed a reimbursement claim.
  • GET /api/chamber_of_deputies/applicant/ — list all applicant names and IDs
  • Filter with ?q= for a case-insensitive name search
Brazilian companies where congresspeople made expenses.
  • GET /api/company/<cnpj>/ — retrieve a company by CNPJ (digits only)

Tapioca-jarbas Python wrapper

A tapioca-wrapper client for the Jarbas API is available on PyPI. Install it and query the API from any Python script without writing manual HTTP calls.
pip install tapioca-jarbas
See the tapioca-jarbas repository for usage examples.

Public instance

The production deployment is available at jarbas.serenata.ai. It is updated whenever Rosie produces a new suspicions dataset.
The CORS policy allows read-only cross-origin requests to all /api/ paths, so browser-based applications can query the API directly.

Build docs developers (and LLMs) love