OpenData

API Documentation

Access budget data programmatically through our RESTful API. Retrieve information about organizations, expenses, resources, and more.

Getting Started

The Budget API provides programmatic access to public budget data. All endpoints return JSON-formatted responses and support various query parameters for filtering and pagination.

Response Format

All responses are returned in JSON format with appropriate HTTP status codes.

Authentication

Currently, this API does not require authentication for public data access. All endpoints are publicly accessible.

Note
Rate limiting may apply to prevent abuse. Please contact us if you need higher rate limits for your application.

Budget Totals

Retrieve total budget figures including expenses and resources for all years, covering both main and complementary budgets.

GET /budget/api/totals/

Parameters

Parameter Type Description
year integer Filter by specific year
include_complementary boolean Include complementary budgets

Response

The response body is JSON formatted with the following structure:

Field Type Description
year integer Budget year
total_expenses number Total expenses
total_resources number Total resources
balance number Budget balance

Budget Categories

Retrieve budget data organized by categories including both expenses and resources.

GET /budget/api/budget-categories/

Parameters

Parameter Type Description
year integer Filter by budget year
type string Filter by type: 'expense' or 'resource'

Response

The response body is JSON formatted with the following structure:

Field Type Description
category string Category name
expenses number Total expenses in category
resources number Total resources in category

Expenses

Retrieve budget expenses with optional hierarchy structure. This endpoint allows you to explore expense data at different levels of detail.

GET /budget/api/expenses/

Parameters

Parameter Type Description
year integer Filter expenses by budget year
hierarchy boolean Return hierarchical structure if true
organization integer Filter by organization ID
limit integer Number of results to return per page
offset integer The initial index from which to return results

Response

The response body is JSON formatted with the following structure:

Field Type Description
id integer Expense record identifier
year integer Budget year
amount number Expense amount
category string Expense category
organization object Associated organization details

Resources

Retrieve budget resources with optional hierarchy structure. Resources represent income and funding sources.

GET /budget/api/resources/

Parameters

Parameter Type Description
year integer Filter resources by budget year
hierarchy boolean Return hierarchical structure if true
limit integer Number of results to return per page
offset integer The initial index from which to return results

Response

The response body is JSON formatted with the following structure:

Field Type Description
id integer Resource record identifier
year integer Budget year
amount number Resource amount
source string Resource source or type

Organization List

Retrieve a list of organizations with their details including name, code, and associated budget information.

GET /budget/api/organization/

Parameters

Parameter Type Description
year integer Filter organizations by budget year
limit integer Number of results to return per page
offset integer The initial index from which to return results

Response

The response body is JSON formatted with the following structure:

Field Type Description
id integer Unique identifier for the organization
name string Name of the organization
code string Organization code

Organization Stats

Retrieve statistical information and aggregated data for organizations.

GET /budget/api/organization/stats/

Parameters

Parameter Type Description
year integer Filter statistics by budget year
organization_id integer Filter by specific organization ID

Response

The response body is JSON formatted with the following structure:

Field Type Description
organization_id integer Organization identifier
total_expenses number Total expenses amount
total_resources number Total resources amount

Debt

Retrieve debt information by origin and year.

GET /budget/api/debt/

Parameters

Parameter Type Description
year integer Filter debt data by year
parent string Filter by parent debt origin (use 'null' for top-level origins)

Response

The response body is JSON formatted with the following structure:

Field Type Description
year integer Year of debt record
debt_origin object Debt origin information (id, parent, name)
value number Debt value in MDT (Million Tunisian Dinars)

Outstanding Debt

Retrieve outstanding debt information - the total amount of money still owed that has not yet been repaid, including remaining principal, accumulated interest, and associated fees.

GET /budget/api/outstanding-debt/

Parameters

Parameter Type Description
year integer or 'last' Filter by year or use 'last' for most recent year

Response

The response body is JSON formatted with the following structure:

Field Type Description
year integer Year of outstanding debt record
outstanding_debt number Total outstanding debt amount in MDT (remaining principal, interest, and fees)
gdp number GDP in MDT
value number Outstanding debt as percentage of GDP

Deficit

Retrieve budget deficit information including absolute values and percentage relative to GDP.

GET /budget/api/deficit/

Response

The response body is JSON formatted with the following structure:

Field Type Description
year integer Budget year
value number Absolute deficit value in MDT
percent number Deficit as percentage of GDP
gdp number GDP in MDT