Requests may experience delays due to the free services we currently utilize.

Public Watch API

Introduction

This API provides access to graft cases and politicians data.

Endpoints

Return a list of politicians with graft cases.

        https://publicwatchke.vercel.app/api/v1/politicians
      

Return a list of graft cases.

        https://publicwatchke.vercel.app/api/v1/graftcases
      

Request:

        curl -X GET https://publicwatchke.vercel.app/api/v1/graftcases
      

Response:

  "graft":[
        {
          "id": 1,
          "politician_id": 10,
          "title": "Case Title",
          "name": "John Doe",
          "case_description": "This is a case description.",
          "legal_outcome": "Win",
          "case_date": "2023-11-28",
          "downvotes": 5,
          "upvotes": 10,
          "link": "https://example.com/case/1",
          "created_at": "2023-11-28T12:34:56",
          "updated_at": "2023-12-01T15:22:33"
        },
        ...
]
    

Request:

        curl -X GET https://publicwatchke.vercel.app/api/v1/politicians
      

Response:

        "success": true,
        "data": {
          "Multiple": [
            {
              "politician_id": 1,
              "name": "Kipchumba Murkomen",
              "office": "Governor",
              "county": "Nandi",
              "political_party": "Kenya Kwanza",
              "source_website": "https://www.standardmedia.co.ke/health/nairobi/article/2001478477/murkomen-corrupt-to-the-core-official-left-ministry-in-may",
              "photo_url": "https://www.ghanamma.com/ke/wp-content/uploads/2022/09/87a95934262148218b7fec4d51bc0154.jpeg",
              "created_at": "2024-08-14T21:12:01.635052",
              "updated_at": "2024-08-14T21:12:01.635052",
              "year_of_birth": 1938,
              "sex": "male"
            },
            ...
            ]
    

Error Handling

All error messages will contain the schema below

        {
          "success": false,
          "error": "Politician with ID 234 Not Found"
        }