MP's profile images

19 views
Skip to first unread message

Joseph Coker

unread,
Sep 18, 2019, 6:43:16 AM9/18/19
to TheyWorkForYou
Hello

Do you have a folder available from which I could download all the Member of Parliament's profile images?

They are all available publicly on the Parliaments beta website (https://beta.parliament.uk/houses/1AFu55Hs/members/current) but it would be quite labour intensive to download them individually for each of the 600 MP's profiles.

No worries if not.

Many Thanks

Joseph

Stephen Paulger

unread,
Sep 18, 2019, 9:35:47 AM9/18/19
to theywor...@mysociety.org
There are various machine readable forms of that webpage that you can get a list of by looking in the HTML source of that page.

<link href="https://api.parliament.uk/query/house_current_members.nt?house_id=1AFu55Hs" rel="alternate" type="application/n-triples">
<link href="https://api.parliament.uk/query/house_current_members.tsv?house_id=1AFu55Hs" rel="alternate" type="text/tab-separated-values">
<link href="https://api.parliament.uk/query/house_current_members.rj?house_id=1AFu55Hs" rel="alternate" type="application/json+rdf">
<link href="https://api.parliament.uk/query/house_current_members.json?house_id=1AFu55Hs" rel="alternate" type="application/json+ld">
<link href="https://api.parliament.uk/query/house_current_members.xml?house_id=1AFu55Hs" rel="alternate" type="application/rdf+xml">
 
The JSON file looks fairly easy to work with.

Each MP has a section in that file something like...

    {
      "@id": "0QZiyyiQ",
      "@type": "Person",
      "personGivenName": "Gordon",
      "personFamilyName": "Marsden",
      "memberHasMemberImage": {
        "@id": "7Ip3z0GX",
        "@type": "MemberImage"
      },
      "memberHasParliamentaryIncumbency": {
        "@id": "OVxdZEv3",
        "@type": "SeatIncumbency",
        "seatIncumbencyHasHouseSeat": {
          "@id": "bzrS2oBd",
          "@type": "HouseSeat",
          "houseSeatHasHouse": {
            "@id": "1AFu55Hs"
          },
          "houseSeatHasConstituencyGroup": {
            "@id": "kvxzsude",
            "@type": "ConstituencyGroup",
            "constituencyGroupName": "Blackpool South"
          }
        }
      },
      "partyMemberHasPartyMembership": {
        "@id": "ysYASuNu",
        "@type": "PartyMembership",
        "partyMembershipHasParty": {
          "@id": "LEYIBvV9"
        }
      }
    }

The ID under memberHasMemberImage can be used to generate an image URL like this https://api.parliament.uk/photo/7Ip3z0GX.jpeg

I don't know what the licenses are for the images, it might be worth checking that.

I hope that helps.
--
You received this message because you are subscribed to the Google Groups "TheyWorkForYou" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theyworkforyo...@mysociety.org.

Reply all
Reply to author
Forward
0 new messages