REST API served from Civil Cases database
The API is written in Python and makes use of the following libraries:
- Flask: A popular microframework to ease routing
- py2neo: To connect to the Neo4J database
These libraries are to be installed through Pip or as instructed by their maintainers.
In URLs listed here, the following notations are used accordingly:
{value}
used to represent some generic value{type:value}
used to represent the data types which could be used
The base URL, one should use in order to access any method is
http://localhost:5000/api/0.1/json/
The following is the standard sample output:
{
"response": [
{
"court_name": "The Administrative Review Tribunal",
"date": "2013-01-25",
"defendant": " Awtorit\u00e0 ghat-Trasport f\u2019Malta ",
"judge": "Gabriella Vella",
"keywords": [
"\u201c22",
"nghaw",
"l-Awtorit\u00e0",
"ml-",
"moghtija"
],
"pdf": "script_get_judgement_document.aspx?CaseJudgementID=78919",
"prosecutor": "Joseph Bajada (Karta ta\u2019 l-Identit\u00e0 bin-Numru 24466G) u S B Autocentre Limited (C-16378) ",
"reference": "1/2011/1"
}
]
}
Outputs a case matching a given reference.
Sample call:
http://localhost:5000/api/0.1/json/case/1/2011
Outputs an appeal matching a given reference.
Sample call:
http://localhost:5000/api/0.1/json/appeal/1/2011/1
where date should have the following structure:
year-month-day
Searches by date.
Sample call:
http://localhost:5000/api/0.1/json/cases/date/2011-05-13
Outputs all appeals.
Sample call:
http://localhost:5000/api/0.1/json/cases/appeals
Deprecated (for now)
Searches by party which could be either prosecutor or defendant. If no party with the specified name and surname is found, an either or condition is applied on the two parameters.
Sample call:
http://localhost:5000/api/0.1/json/cases/party/gillford/brian
Similar to /cases/party/{surname}/{name}
above, but name and surname can be in any order.
Sample call:
http://localhost:5000/api/0.1/json/cases/party?surname=gillford&name=brian
GET parameters:
- name
- surname
Searches for cases by judge name and surname.
Sample call:
http://localhost:5000/api/0.1/json/cases/judge/vella/gabriella
Similar to /cases/judge/{surname}/{name}
above, but name and surname can be in any order.
Sample call:
http://localhost:5000/api/0.1/json/cases/judge
GET parameters:
- name
- surname
where keywords is a list of keywords seperated by a comma.
Outputs all cases associated to those particular keywords.
Sample calls:
http://localhost:5000/api/0.1/json/cases/keywords/qtil
http://localhost:5000/api/0.1/json/cases/keywords/serqa go bank
Output:
{"error": "Not found"}
Output:
{"error": "Internal error"}