What is the API Guide?
The API Guide is a comprehensive resource designed to help developers efficiently understand and utilize the API of the Health Data Platform. It offers detailed information on authentication, available endpoints, request and response formats, and more, ensuring seamless integration of the API into your applications, enabling process automation, and smooth data access.
The guide provides thorough instructions on how to effectively use request URLs, supported by illustrative examples in various programming languages. It also includes tables that outline key parameters and headers used in requests, along with explanations of potential responses, helping you understand how the API works and how to interact with it effectively.
- We recommend regularly reviewing this section to stay informed about any updates that may affect your usage.
- The maximum number of requests allowed per user is (10), so please ensure you do not exceed this limit to avoid service disruption.
- Access to the Health Data Platform’s API does not require an API key, as interaction with the endpoints can be done directly without authentication.
Fetching Dataset InformationV1.0GEt
- V1.0: Represents the current version of the API. It is recommended to check this section regularly for updates that may affect usage.
- GET: This function is used to retrieve data from the system by sending a specific request.
- Request URL: This is the direct link that allows you to access the dataset through the API.
https://hdp.moh.gov.sa/api/v1/[resourceId]
API Example usage
Here are examples demonstrating how to use the API with various programming tools. Select the programming language tab that best fits your needs.
- Python
- JavaScript
- PHP
- CURL
import requests url = "https://open-data-portal.devclan.io/api/v1/[resourceId]" payload = {} headers = { 'culture': '<String>', 'Accept': 'text/plain', 'Cookie': '__cf_bm=GLI75xYpw1tiPJpUzNp2xyqyehUk33aASaEceQE4TFQ-1726516105-1.0.1.1-2WlNbdIBifT5XMEt.UGhpx.G4plkSgcn.8YmZ9UobwlENN3.Ggw7PQDDWT3KdB4OX7o7FH21XMpu8swrn_jOeQ; NEXT_LOCALE=ar' } response = requests.request("GET", url, headers=headers, data=payload) print(response.text)
Expected Response
- 200
- 404
- 400
- 500
{ "transactionId": "String", "datasetId": "String", "resources": [ { "id": "String", "name": "String", "descriptionEn": "String", "descriptionAr": "String", "format": "String", "columns": [ { "name": "String", "type": "String", "description": "String" } ], "downloadUrl": "String", "createdAt": "String", "updatedAt": "String" } ] }