# MALAYSIA-STATES

## GitHub documentation

{% embed url="<https://github.com/JianLoong/malaysia-api>" %}

## Usage

1\. Making an HTTP request via a web browser or API platform etc.[ ](https://www.postman.com/)[Postman](https://www.postman.com/).

2\. The following parameters are accepted:

<table data-header-hidden><thead><tr><th width="170.33333333333331">Name</th><th>Description</th><th>Format</th></tr></thead><tbody><tr><td>code</td><td>State or federal territory code</td><td>E.g. 08 (Perak)</td></tr><tr><td>download</td><td>To download the JSON output</td><td>Empty or any value is fine</td></tr></tbody></table>

3. Depending on the parameters, the script will construct a URL to fetch information from the GitHub owner's API accordingly.

## **Parameter Guidelines**

* `code` **parameter:**
  * The script will retrieve information of a state according to its code.
* `download` **parameter**
  * The JSON output will be automatically downloaded from the web browser. See the download sample at [here](#download).

## References

### List of state codes in Malaysia

{% embed url="<https://en.wikipedia.org/wiki/ISO_3166-2:MY>" %}

## Demo

{% embed url="<https://api.kosontechnology.com/malaysia-states.php?code=08>" %}
Retrieves information of Perak state
{% endembed %}

{% embed url="<https://api.kosontechnology.com/malaysia-states.php?code=07>" %}
Retrieves information of Pulau Pinang state
{% endembed %}

## Download

{% embed url="<https://api.kosontechnology.com/malaysia-states.php?code=08&download=>" %}
