Lebanese Parliament API (nouwweb)¶
About¶
This is an API to query information about Lebanese members of parliament. The current data reflects the 2009 Parliament. The project is a joint effort by SMEX and Lamba Labs.
Important links:
- Repository: https://github.com/openleb/nouwweb
- Issues: https://github.com/openleb/nouwweb/issues
- Documentation: http://nouwweb.rtfd.org/
Usage¶
The API is very simple to use and follows REST parameter conventions. A request to the API will return a JSON list of results according to the URL param string.
Users can either get a list of values such as the list of districts at the endpoint /districts, or search for a subset of members of parliament using the endpoint /search.
For example, here’s the list of legislators that have a mobile phone in the district Beirut I
curl 'http://api.openleb.io/search?mobile=true&district=Beirut%20I&prettyprint=true'
API details:
Search¶
The /search endpoint is the main access to the API and allows the user to find information about the current members of parliament. There are multiple paramaters that can be added to the URL to filter and group the results of a query.
To add a parameter it should be in the form:
&key=value
If a value contains a space it should be properly encoded. As an example, here’s the endpoint for all the legislators in Beirut I that have a mobile phone.
/search?mobile=true&district=Beirut%20I
Note
In some parameters such as district and parties, the value of the parameter has to correspond to an existing value from a list we provide at a different API endpoint such as /districts and /parties.
district¶
The district that the member of parliament represents. The name should be one that appears at the API endpoint /districts
# List legislators that represent the district of Metn
&district=Metn
deputies_terms¶
The terms in parliament in which the legislator has been elected.
# List legislators that were in the 1992 parliament
&deputies_term=1992
party¶
The legislators that belong to a certain political party. The name should be one that appears at the API endpoint /parties
# List legislators that are part of the Zahle Bloc
&party=Zahle%20Bloc
sect¶
The legislators that belong to a certain sect. The name should be one that appears at the API endpoint /sects
# List legislators that are Maronite
§=Maronite
mobile¶
Can be either true or false. Lists representatives for which we have a mobile number.
# List legislators for which we know the mobile phone
&mobile=true
phone¶
Can be either true or false. Lists representatives for which we have a landline number.
# List legislators for which we know the landline phone
&phone=true
fax¶
Can be either true or false. Lists representatives for which we have a fax number.
# List legislators for which we know the fax number
&fax=true
twitter¶
Can be either true or false. Lists representatives that have a twitter account.
# List legislators that have a twitter account
&twitter=true
facebook¶
Can be either true or false. Lists representatives that have a facebook account.
# List legislators that have a facebook account
&facebook=true
email¶
Can be either true or false. Lists representatives that have an email account.
# List legislators that have a an email account
&email=true
prettyprint¶
Can be either true or false. Indents the response for pretty printing.
Lists¶
The API provides for four endpoints that will generate lists of data. These are useful for secondary queries to the /search endpoint.
/names¶
Returns the list of names of the 2009 legislators in English and in Arabic.
/districts¶
Returns the list of districts and the number of legislators in that district.
/parties¶
Returns the list of political parties and the number of legislators of that party. Some parliamentary members belong to two parties. The list will account for that by creating a duplicate listing that includes both parties.
Legislator belongs to A and B then the list will be:
- A
- B
- A,B
- ...
/sects¶
Returns the list of sects and the number of legislators that are part of that sect.
Contributing¶
To contribute, fork the [github repo](http://github.com/openleb/nouwweb) or [raise an issue](http://github.com/openleb/issues). You can also suggest changes on our mailing list [here](https://groups.google.com/forum/#!forum/openleb)
Authors¶
- Marc Farra [kamicut](http://github.com/kamicut)
- Maya Kreidieh [acrylc](http://github.com/acrylc)
- Jessica Dheere [jessdheere](http://github.com/jessdheere)
- Mohamad Najem [MoNajem](http://github.com/MohamadNajem)
- Joey Ayoub [joeyayoub](https://twitter.com/joeyayoub)