TheyWorkForYou API
getMSP function

https://www.theyworkforyou.com/api/getMSP

Fetch a particular MSP.

Arguments

postcode (optional)
Fetch the MSPs for a particular postcode.
constituency (optional)
The name of a constituency.
id (optional)
If you know the person ID for the member you want (returned from getMSPs or elsewhere), this will return data for that person.
always_return (optional)
For the postcode and constituency options, sets whether to always try and return an MSP (due to e.g. the period before an election when there are no MSPs).

Example Response

<twfy>
  </twfy>

Explorer

Try out this function without writing any code!

id:
constituency:
postcode:
always_return:
Output: