# 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=>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-gitbook.kosontechnology.com/malaysia-states.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
