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.
توزيع الديون
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.
إجماليات الميزانية
استرجاع أرقام الميزانية الإجمالية بما في ذلك النفقات والموارد لجميع السنوات، وتغطية الميزانية الرئيسية والميزانيات التكميلية.
GET
/budget/api/totals/
Parameters
Parameter
النوع
الوصف
year
integer
تصفية حسب السنة المحددة
include_complementary
boolean
تضمين الميزانيات التكميلية
Response
The response body is JSON formatted with the following structure:
Field
النوع
الوصف
year
integer
سنة الميزانية
total_expenses
number
إجمالي النفقات
total_resources
number
إجمالي الموارد
balance
number
رصيد الميزانية
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));
فئات الميزانية
استرجاع بيانات الميزانية المنظمة حسب الفئات، بما في ذلك النفقات والموارد.
GET
/budget/api/budget-categories/
Parameters
Parameter
النوع
الوصف
year
integer
تصفية حسب سنة الميزانية
type
string
تصفية حسب النوع: 'نفقة' أو 'مورد'
Response
The response body is JSON formatted with the following structure:
Field
النوع
الوصف
category
string
اسم الفئة
expenses
number
إجمالي النفقات في الفئة
resources
number
إجمالي الموارد في الفئة
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));
النفقات
استرجاع نفقات الميزانية مع هيكل هرمي اختياري. تتيح لك هذه النقطة استكشاف بيانات النفقات على مستويات مختلفة من التفاصيل.
GET
/budget/api/expenses/
Parameters
Parameter
النوع
الوصف
year
integer
تصفية النفقات حسب سنة الميزانية
hierarchy
boolean
إرجاع الهيكل الهرمي إذا كان صحيحًا
organization
integer
تصفية حسب معرف المنظمة
limit
integer
عدد النتائج المطلوب إرجاعها لكل صفحة
offset
integer
الفهرس الأولي الذي يتم منه إرجاع النتائج
Response
The response body is JSON formatted with the following structure:
Field
النوع
الوصف
id
integer
معرف سجل النفقة
year
integer
سنة الميزانية
amount
number
مبلغ النفقة
category
string
فئة النفقة
organization
object
تفاصيل المنظمة المرتبطة
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));
الموارد
استرجاع موارد الميزانية مع هيكل هرمي اختياري. تمثل الموارد الإيرادات ومصادر التمويل.
GET
/budget/api/resources/
Parameters
Parameter
النوع
الوصف
year
integer
تصفية الموارد حسب سنة الميزانية
hierarchy
boolean
إرجاع الهيكل الهرمي إذا كان صحيحًا
limit
integer
عدد النتائج المطلوب إرجاعها لكل صفحة
offset
integer
الفهرس الأولي الذي يتم منه إرجاع النتائج
Response
The response body is JSON formatted with the following structure:
Field
النوع
الوصف
id
integer
معرف سجل المورد
year
integer
سنة الميزانية
amount
number
مبلغ المورد
source
string
مصدر أو نوع المورد
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));
قائمة المنظمات
استرجاع قائمة المنظمات مع تفاصيلها بما في ذلك الاسم والرمز ومعلومات الميزانية المرتبطة.
GET
/budget/api/organization/
Parameters
Parameter
النوع
الوصف
year
integer
تصفية المنظمات حسب سنة الميزانية
limit
integer
عدد النتائج المطلوب إرجاعها لكل صفحة
offset
integer
الفهرس الأولي الذي يتم منه إرجاع النتائج
Response
The response body is JSON formatted with the following structure:
Field
النوع
الوصف
id
integer
معرف فريد للمنظمة
name
string
اسم المنظمة
code
string
رمز المنظمة
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));
إحصائيات المنظمات
استرجاع المعلومات الإحصائية والبيانات المجمعة للمنظمات.
GET
/budget/api/organization/stats/
Parameters
Parameter
النوع
الوصف
year
integer
تصفية الإحصائيات حسب سنة الميزانية
organization_id
integer
تصفية حسب معرف منظمة محدد
Response
The response body is JSON formatted with the following structure:
Field
النوع
الوصف
organization_id
integer
معرف المنظمة
total_expenses
number
إجمالي مبلغ النفقات
total_resources
number
إجمالي مبلغ الموارد
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));
الديون
استرجاع معلومات الديون حسب المصدر والسنة.
GET
/budget/api/debt/
Parameters
Parameter
النوع
الوصف
year
integer
تصفية بيانات الديون حسب السنة
parent
string
تصفية حسب مصدر الدين الأصلي (استخدم 'null' لمصادر المستوى الأعلى)
Response
The response body is JSON formatted with the following structure:
Field
النوع
الوصف
year
integer
سنة سجل الدين
debt_origin
object
معلومات مصدر الدين (المعرف، الأصل، الاسم)
value
number
قيمة الدين بالمليون دينار تونسي
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));
الدين المستحق
استرجاع معلومات الدين المستحق - المبلغ الإجمالي من المال الذي لا يزال مستحقًا ولم يتم سداده بعد، بما في ذلك المبلغ الأصلي المتبقي والفوائد المتراكمة والرسوم المرتبطة.
GET
/budget/api/outstanding-debt/
Parameters
Parameter
النوع
الوصف
year
integer or 'last'
تصفية حسب السنة أو استخدم 'last' لأحدث سنة
Response
The response body is JSON formatted with the following structure:
Field
النوع
الوصف
year
integer
سنة سجل الدين المستحق
outstanding_debt
number
المبلغ الإجمالي للدين المستحق بالمليون دينار تونسي (المبلغ الأصلي المتبقي والفوائد والرسوم)
gdp
number
الناتج المحلي الإجمالي بالمليون دينار تونسي
value
number
الدين المستحق كنسبة مئوية من الناتج المحلي الإجمالي
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));
العجز
استرجاع معلومات العجز في الميزانية بما في ذلك القيم المطلقة والنسبة المئوية بالنسبة للناتج المحلي الإجمالي.
GET
/budget/api/deficit/
Response
The response body is JSON formatted with the following structure:
Field
النوع
الوصف
year
integer
سنة الميزانية
value
number
القيمة المطلقة للعجز بالمليون دينار تونسي
percent
number
العجز كنسبة مئوية من الناتج المحلي الإجمالي
gdp
number
الناتج المحلي الإجمالي بالمليون دينار تونسي
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));