Overview

Returns a list of current month's prayer times for a specific location.

Parameters

The parameters are passed using GET method.

Parameter Sample description
code kdh-4 Required. The location code or the location name which prayer times to be obtained.
filter 3

One of the values below. If no value is specified, defaults to 3.

1 Filters the prayer time to the current day.
2 Filters the prayer time to the current week.
3 Filters the prayer time to the current month.
appid mpt-json-api Used for statistical purposes. The name of the application using this API.
appurl http://mpt.i906.my Used for statistical purposes. The url of the application using this API.

Response fields

meta

code Returns 200 if the request was successful. Returns 400 if any error occurred.
errorType

Returns one of the values below if there an error occured.

ERROR_NO_PLACE No place was specified, unknown code was use or the location was not found in the database.
ERROR_ESOLAT No cached prayer time available and an error occurred while connecting to www.esolat.gov.my.
ERROR_INVALID_DATA Unexpected response received from www.esolat.gov.my.
ERROR_UNKNOWN Unexpected error has occured.
errorDescription The description of the error that has occured.

response

times The prayer times formatted in UNIX timestamp.
place The name of the location.
code The location code used.
jakim The code used to retrieve data from www.esolat.gov.my.

Request Example

A sample response from http://mpt.i906.my/mpt.json?code=kdh-4&filter=2.

{
  "meta": {
    "code": 200
  },
  "response": {
    "times": [
      [
        1352065560, 1352070180, 1352091840, 1352103840, 1352113200, 1352117460
      ],
      [
        1352151960, 1352156640, 1352178240, 1352190300, 1352199600, 1352203860
      ],
      [
        1352238360, 1352243040, 1352264640, 1352276700, 1352286000, 1352290320
      ],
      [
        1352324760, 1352329440, 1352351040, 1352363100, 1352372400, 1352376720
      ],
      [
        1352411220, 1352415840, 1352437440, 1352449500, 1352458800, 1352463120
      ],
      [
        1352497620, 1352502240, 1352523840, 1352535900, 1352545200, 1352549520
      ],
      [
        1352584020, 1352588700, 1352610240, 1352622300, 1352631600, 1352635920
      ]
    ],
    "place": "Kubang Pasu",
    "code": "kdh-4",
    "jakim": "kdh02"
  }
}