-
Notifications
You must be signed in to change notification settings - Fork 0
/
mpt-server-api.yaml
508 lines (498 loc) · 16.6 KB
/
mpt-server-api.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
openapi: 3.0.0
servers:
- url: https://api.waktusolat.app
description: Default server
- url: https://mpt-server.vercel.app/api
description: Same server, but on Vercel domain
info:
description: |
# Introduction/Pengenalan
The Malaysia Waktu Solat API provides accurate prayer times (waktu solat) for various locations in Malaysia. It offers information on monthly prayer timings, zone detection based on coordinates and more.
Malaysia Waktu Solat API menyediakan data waktu solat yang tepat untuk kesemua tempat di Malaysia. Kami menyediakan maklumat seperti waktu solat bulanan, pengesanan zon berdasarkan koordinat dan lain-lain.
## How prayer time data is collected/Bagaimana data waktu solat dikumpulkan
We collect the data by tapping inside [JAKIM's e-solat](https://www.e-solat.gov.my/) API in some pre-determined frequency. To maintain stability and availability of this API, we store the data snapshot on our own database. **Disclaimer:** JAKIM API is undocumented and probably not meant to be used by the public, as it can change without prior notice. Hence, we try our
best to adapt for every new changes with the API to keep the data remains up to date every year. For more technical details, visit our repository at https://github.com/mptwaktusolat/api-waktusolat
Kami mengumpulkan data dengan mengakses API dari laman [e-solat JAKIM](https://www.e-solat.gov.my/) dalam beberapa sela masa yang ditetapkan. Untuk mengekalkan kestabilan dan ketersediaan data sepanjang masa, kami menyimpan data tersebut
ke dalam pangkalan data kami. **Penafian:** Jakim e-solat API tidak didokumenkan secara rasmi, mungkin ia tidak direka untuk kegunaan luar, jadi terdapat risiko untuk struktur data berubah tanpa sebarang pemberitahuan.
Kami berusaha sedaya upaya kami untuk mengadaptasi supaya qualiti data dapat dikekalkan sepanjang masa. Untuk maklumat teknikal, sila lawati repository kami di https://github.com/mptwaktusolat/api-waktusolat
## Disclaimer/Penafian
The Malaysia Waktu Solat API service is provided without warranty, and users access it at their own risk, acknowledging that the service may not be error-free, available at all times, or secure, and the provider is not liable for any damages arising from its use.
Perkhidmatan Malaysia Waktu Solat API ini disediakan tanpa waranti, dan pengguna mengaksesnya atas risiko sendiri, mengakui bahawa perkhidmatan mungkin tidak bebas dari kesilapan, tidak sentiasa tersedia, atau selamat, dan penyedia tidak bertanggungjawab atas sebarang kerosakan yang timbul daripada penggunaannya.
version: 1.0.0
title: Waktu Solat API
contact:
name: Malaysia Prayer Time
email: [email protected]
url: https://waktusolat.app
x-logo:
url: "https://imgur.com/umII6oL.png"
altText: MPT Server banner
license:
name: MIT License
url: "https://opensource.org/license/mit/"
tags:
- name: solat v2
description: Prayer time information (version 2)
- name: solat
description: Prayer time information
- name: zones
description: Zones and location information
- name: mosque
description: Mosque banner images
- name: Jadual Solat
description: Downloadable Prayer timtable in PDF
x-tagGroups:
- name: Prayer times
tags:
- solat
- solat v2
- zones
- mosque
paths:
/solat:
get:
tags:
- solat
summary: Prayer time for all zone
deprecated: true
description: Prayer time for all zone for current month
operationId: getAllPrayerTime
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Solat"
"/solat/{zone}":
get:
tags:
- solat
summary: Prayer time by zone
description: Return a list of Solat information for the current month for the given zone
operationId: getZonePrayerTime
deprecated: true
parameters:
- name: zone
in: path
description: Zone code. See list of zones code [here](/locations).
example: "sgr01"
required: true
schema:
type: string
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Solat"
"404":
description: Solat not found
"/solat/{zone}/{day}":
get:
tags:
- solat
summary: Prayer time by zone
description: Return a list of Solat information for the current month in the given day for the given zone
operationId: getZoneTodayPrayerTime
deprecated: true
parameters:
- name: zone
in: path
description: Zone code. See list of zones code [here](/locations).
example: "sgr01"
required: true
schema:
type: string
- name: day
in: path
description: Day
required: true
schema:
type: string
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Solat"
"404":
description: Solat not found. You may have provided zone code that doesn't exist or out of range day number
"/v2/solat/{zone}":
get:
tags:
- solat v2
summary: Prayer time by zone
description: Return prayer times for the current month in the given day for the given zone.
operationId: getPrayerTime
parameters:
- name: zone
in: path
description: Zone code. See list of zones code [here](/locations).
example: "sgr01"
required: true
schema:
type: string
- name: year
in: query
description: "Year for prayer data. If empty, default to current year."
example: "2024"
schema:
type: integer
- name: month
in: query
description: "Month number (eg: `1` for January, `2` for February etc.). If empty, default to current month"
example: "3"
schema:
type: integer
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/SolatV2"
"404":
description: Data not found. Probably the solat data for the given month and year is not retrived yet. Please contact developer.
"500":
description: Error when parsing the parameter provided.
"/v2/solat/gps/{lat}/{long}":
get:
tags:
- solat v2
summary: Prayer time by GPS (Beta)
description: Return prayer times for the current month in the GPS coordinates (Latitude & Longitude)
operationId: getPrayerTime
parameters:
- name: lat
in: path
description: Latitude component
example: "3.25293"
required: true
schema:
type: number
- name: long
in: path
description: Longitude component
example: "101.73268"
required: true
schema:
type: number
- name: year
in: query
description: "Year for prayer data. If empty, default to current year."
example: "2024"
schema:
type: integer
- name: month
in: query
description: "Month number (eg: `1` for January, `2` for February etc.). If empty, default to current month"
example: "3"
schema:
type: integer
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/SolatV2"
"404":
description: Data not found. Probably the solat data for the given month and year is not retrived yet. Please contact developer.
"500":
description: Error when parsing the parameter provided.
/zones:
get:
tags:
- zones
summary: All zones
description: Return all zones information. See zones visually at https://peta.waktusolat.app
operationId: getAllZones
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Zones"
"500":
description: Internal Server Error. An error occured while processing your request
/zones/{zoneCode}:
get:
tags:
- zones
summary: Zones for the given state
description: Return zones information for the given zone code only. It is like a filter.
operationId: getFilteredZones
parameters:
- name: zoneCode
in: path
description: "Initial zone code. Eg: `prk`, `sgr` etc."
required: true
example: "prk"
schema:
type: string
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Zones"
"404":
description: Provided zone code doesn't exist
"500":
description: Internal Server Error. An error occured while processing your request
/zones/gps:
get:
tags:
- zones
summary: Get zone by GPS coordinate
description: Return zone information for the given latitude and longitude
operationId: getZonesbyGps
parameters:
- name: lat
in: query
description: "Latitude"
example: "3.2485"
required: true
schema:
type: number
- name: long
in: query
description: "Longitude"
example: "101.739"
required: true
schema:
type: number
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/SimpleZone"
"400":
description: Please supply all the required parameters
"404":
description: No zone code found for the supplied coordinate
"500":
description: Internal Server Error. An error occured while processing your request
/mosque/{zoneCode}:
get:
tags:
- mosque
summary: Get mosque image for the given zone
description: "Return an image URL for the given zone. For example: `sgr` (Selangor) will give you SHAS IIUM Mosque. List for all images are listed [here](/mosques)"
operationId: getMosqueImage
parameters:
- name: zoneCode
in: path
description: "Initial zone code. Eg: `prk`, `sgr` etc."
required: true
example: sgr
schema:
type: string
responses:
"200":
description: successful operation
content:
image/*:
schema:
type: string
format: binary
"405":
description: Invalid input
/jadual_solat:
get:
tags:
- Jadual Solat
summary: Get monthly prayer timetable
description: "Note: The request may take a little long time to process on the first call. Then, it will be cached on the CDN"
operationId: getMosqueImage
parameters:
- name: zone
in: query
description: "Zone code. Eg: `SBH01`, `WLY02`"
required: true
example: 'PRK01'
schema:
type: string
- name: year
in: query
description: "Year. If not defined, will use current year."
required: true
example: 2024
schema:
type: number
- name: month
in: query
description: "Month (1 = Jan, 2 = Feb, etc.) If not defined, will use the current monnth"
required: true
schema:
type: number
example: 1
responses:
"200":
description: successful operation
content:
application/pdf:
schema:
type: string
format: binary
"405":
description: Invalid input
components:
schemas:
Solat:
type: object
properties:
prayerTime:
type: array
items:
type: object
properties:
hijri:
type: string
format: date
description: Hijri date
example: "1444-10-10"
date:
type: string
format: string
description: Gregorian date
example: "01-May-2023"
day:
type: string
description: Day of the week
example: "Monday"
imsak:
type: string
format: time
description: Imsak time
example: "05:44:00"
fajr:
type: string
format: time
description: Fajr time
example: "05:54:00"
syuruk:
type: string
format: time
description: Syuruk time
example: "07:02:00"
dhuhr:
type: string
format: time
description: Dhuhr time
example: "13:13:00"
asr:
type: string
format: time
description: Asr time
example: "16:31:00"
maghrib:
type: string
format: time
description: Maghrib time
example: "19:20:00"
isha:
type: string
format: time
description: Isha time
example: "20:31:00"
SolatV2:
type: object
properties:
zone:
type: string
example: SGR01
year:
type: integer
example: 2024
month:
type: string
description: Month name. All possible values - JAN | FEB | MAR | APR | MAY | JUN | JUL | AUG | SEP | OCT | NOV | DEC
example: MAR
last_updated:
type: string
format: date-time
example: "2024-02-15T02:46:55.209Z"
prayers:
type: array
items:
type: object
properties:
hijri:
type: string
format: date
description: Hijri date
example: "1445-08-20"
day:
type: integer
description: Day number for the month
example: 1
fajr:
type: integer
format: date-time
description: Epoch timestamp in seconds
example: 1709244960
syuruk:
type: integer
format: date-time
description: Epoch timestamp in seconds
example: 1709248920
dhuhr:
type: integer
format: date-time
description: Epoch timestamp in seconds
example: 1709270880
asr:
type: integer
format: date-time
description: Epoch timestamp in seconds
example: 1709282580
maghrib:
type: integer
format: date-time
description: Epoch timestamp in seconds
example: 1709292540
isha:
type: integer
format: date-time
description: Epoch timestamp in seconds
example: 1709296680
Zones:
type: array
items:
type: object
properties:
jakimCode:
type: string
description: Jakim code
example: "KDH01"
negeri:
type: string
description: State
example: "Kedah"
daerah:
type: string
description: District
example: "Kota Setar, Kubang Pasu, Pokok Sena"
SimpleZone:
type: object
properties:
state:
type: string
description: Negeri
example: "SGR"
district:
type: string
description: State
example: "Gombak"
zone:
type: string
description: Prayer time zone
example: "SGR01"