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
Code Examples
CURL
PYTHON
NODE.JS
Example Request
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/totals/" \
-H "Accept: application/json"
With Parameters
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/totals/?year=2024&limit=10" \
-H "Accept: application/json"
Example Request
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/totals/"
headers = {"Accept": "application/json"}
response = requests.get(url, headers=headers)
print(response.json())
With Parameters
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/totals/"
params = {"year": 2024, "limit": 10}
headers = {"Accept": "application/json"}
response = requests.get(url, params=params, headers=headers)
print(response.json())
Example Request
Copy
const fetch = require('node-fetch');
const url = "https://budgetv3.marsad.tn/budget/api/totals/";
fetch(url, {
headers: {
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data));
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
Code Examples
CURL
PYTHON
NODE.JS
Example Request
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/budget-categories/" \
-H "Accept: application/json"
With Parameters
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/budget-categories/?year=2024&limit=10" \
-H "Accept: application/json"
Example Request
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/budget-categories/"
headers = {"Accept": "application/json"}
response = requests.get(url, headers=headers)
print(response.json())
With Parameters
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/budget-categories/"
params = {"year": 2024, "limit": 10}
headers = {"Accept": "application/json"}
response = requests.get(url, params=params, headers=headers)
print(response.json())
Example Request
Copy
const fetch = require('node-fetch');
const url = "https://budgetv3.marsad.tn/budget/api/budget-categories/";
fetch(url, {
headers: {
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data));
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
Code Examples
CURL
PYTHON
NODE.JS
Example Request
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/expenses/" \
-H "Accept: application/json"
With Parameters
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/expenses/?year=2024&limit=10" \
-H "Accept: application/json"
Example Response
Copy
[
{
"id": 1,
"year": 2024,
"amount": 150000.00,
"category": "Personnel",
"organization": {
"id": 1,
"name": "Department of Finance"
}
}
]
Example Request
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/expenses/"
headers = {"Accept": "application/json"}
response = requests.get(url, headers=headers)
print(response.json())
With Parameters
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/expenses/"
params = {"year": 2024, "limit": 10}
headers = {"Accept": "application/json"}
response = requests.get(url, params=params, headers=headers)
print(response.json())
Example Request
Copy
const fetch = require('node-fetch');
const url = "https://budgetv3.marsad.tn/budget/api/expenses/";
fetch(url, {
headers: {
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data));
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
Code Examples
CURL
PYTHON
NODE.JS
Example Request
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/resources/" \
-H "Accept: application/json"
With Parameters
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/resources/?year=2024&limit=10" \
-H "Accept: application/json"
Example Request
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/resources/"
headers = {"Accept": "application/json"}
response = requests.get(url, headers=headers)
print(response.json())
With Parameters
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/resources/"
params = {"year": 2024, "limit": 10}
headers = {"Accept": "application/json"}
response = requests.get(url, params=params, headers=headers)
print(response.json())
Example Request
Copy
const fetch = require('node-fetch');
const url = "https://budgetv3.marsad.tn/budget/api/resources/";
fetch(url, {
headers: {
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data));
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
Code Examples
CURL
PYTHON
NODE.JS
Example Request
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/organization/" \
-H "Accept: application/json"
With Parameters
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/organization/?year=2024&limit=10" \
-H "Accept: application/json"
Example Response
Copy
[
{
"id": 1,
"name": "Department of Finance",
"code": "FIN001"
}
]
Example Request
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/organization/"
headers = {"Accept": "application/json"}
response = requests.get(url, headers=headers)
print(response.json())
With Parameters
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/organization/"
params = {"year": 2024, "limit": 10}
headers = {"Accept": "application/json"}
response = requests.get(url, params=params, headers=headers)
print(response.json())
Example Request
Copy
const fetch = require('node-fetch');
const url = "https://budgetv3.marsad.tn/budget/api/organization/";
fetch(url, {
headers: {
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data));
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
Code Examples
CURL
PYTHON
NODE.JS
Example Request
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/organization/stats/" \
-H "Accept: application/json"
With Parameters
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/organization/stats/?year=2024&limit=10" \
-H "Accept: application/json"
Example Request
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/organization/stats/"
headers = {"Accept": "application/json"}
response = requests.get(url, headers=headers)
print(response.json())
With Parameters
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/organization/stats/"
params = {"year": 2024, "limit": 10}
headers = {"Accept": "application/json"}
response = requests.get(url, params=params, headers=headers)
print(response.json())
Example Request
Copy
const fetch = require('node-fetch');
const url = "https://budgetv3.marsad.tn/budget/api/organization/stats/";
fetch(url, {
headers: {
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data));
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)
Code Examples
CURL
PYTHON
NODE.JS
Example Request
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/debt/" \
-H "Accept: application/json"
With Parameters
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/debt/?year=2024&limit=10" \
-H "Accept: application/json"
Example Request
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/debt/"
headers = {"Accept": "application/json"}
response = requests.get(url, headers=headers)
print(response.json())
With Parameters
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/debt/"
params = {"year": 2024, "limit": 10}
headers = {"Accept": "application/json"}
response = requests.get(url, params=params, headers=headers)
print(response.json())
Example Request
Copy
const fetch = require('node-fetch');
const url = "https://budgetv3.marsad.tn/budget/api/debt/";
fetch(url, {
headers: {
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data));
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
Code Examples
CURL
PYTHON
NODE.JS
Example Request
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/outstanding-debt/" \
-H "Accept: application/json"
With Parameters
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/outstanding-debt/?year=2024&limit=10" \
-H "Accept: application/json"
Example Request
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/outstanding-debt/"
headers = {"Accept": "application/json"}
response = requests.get(url, headers=headers)
print(response.json())
With Parameters
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/outstanding-debt/"
params = {"year": 2024, "limit": 10}
headers = {"Accept": "application/json"}
response = requests.get(url, params=params, headers=headers)
print(response.json())
Example Request
Copy
const fetch = require('node-fetch');
const url = "https://budgetv3.marsad.tn/budget/api/outstanding-debt/";
fetch(url, {
headers: {
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data));
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
Code Examples
CURL
PYTHON
NODE.JS
Example Request
Copy
curl -X GET "https://budgetv3.marsad.tn/budget/api/deficit/" \
-H "Accept: application/json"
Example Request
Copy
import requests
url = "https://budgetv3.marsad.tn/budget/api/deficit/"
headers = {"Accept": "application/json"}
response = requests.get(url, headers=headers)
print(response.json())
Example Request
Copy
const fetch = require('node-fetch');
const url = "https://budgetv3.marsad.tn/budget/api/deficit/";
fetch(url, {
headers: {
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data));