https://e-luxmobile.com/sim-details/
The goal is converting the official website's services into an API by:
- Handling POST requests with the form fields data, in JSON format
- Doing some webscraping to extract data from the HTML response
- Retruning the response to the user as JSON
This API can be useful used for automation purposes.
{
"id": number,
"phone": number
}
{
"Phone Number": string,
"ICCID": string,
"Status": string,
"Activation Date": string,
"Registration Date": string,
"Last Top Up Date": string,
"Dormant Date": string,
"Terminated Date": string,
"Cash Balance": string,
"Minutes Balance": string,
"Data Balance": string
}
- Node.js
- Express.js
- axios
- form-data
- jsdom
- Request SIM details from the official website and get the raw response (HTML) file
- Extract data from the recieved webpage (Web Scraping)
- Return the result as JSON
npm install
or
yarn
You can use the development server (with nodemon) by running:
npm run dev
or
yarn dev
By default, the server listen on port 3000:
npm start
or
yarn start
But the port can be modified by set the environement variable "PORT".
curl --location --request POST 'https://elux-api.onrender.com' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "YOUR_REGISTERED_ID_NUM",
"phone": "352000000000"
}'