Scrapping Da Ma Cai 4D Results

Photo by Dev Leigh on Unsplash

Scrapping Da Ma Cai 4D Results


2 min read

Tips for scrapping drawing results from Da Ma Cai (a lottery in Malaysia) website. This method works as of 7 July 2024. This is an undocumented method and not officially supported, so it might not work in future.


The information provided in this article is for educational purposes only. Web scraping practices and legalities can vary depending on the website and your location. It is your responsibility to ensure you have the necessary permissions before scraping data from any website. Scraping data without permission may violate the website's terms of service or even local laws.

Get Draw Dates

Draws are conducted every Wednesday, Saturday and Sunday at 7 PM, and some Tuesdays. So it is not always consistent. If you need to get draw results for different days, you need to know what are the draw dates.

Send a GET request to It returns a JSON object with a single drawdate attribute. The value is a string containing recent draw dates separated by space. The dates are in "YYYYMMDD" format.

This is a bad design. They could have used an array instead of string. Take note of the trailing space in this string. I recommend ISO 8601 date format for APIs.

Example request

curl ''

URL Link For Draw Results

To get the draw results, you must first retrieve an URL link (for a selected date). This link will direct you to the draw results.

Send a GET request to<YYMMDD>. Replace "<YYMMDD>" with a draw date. You must include a HTTP header cookiesession: 363.

Example request

curl -H 'cookiesession: 363' ''

Example result


It seems to be signed and valid for 1 hour.

Final Step

Send a GET request to the link URL. The response is draw results in JSON format. There is a number of spelling errors. "Past" is sometime spelt as "pass", "consolation" is sometime spelt as "consolidate". The misspelled words and inconsistent naming convention triggers my OCD 🤢.

Example request

curl ''


Did you find this article valuable?

Support Hong by becoming a sponsor. Any amount is appreciated!