eLUX API
SIM Details
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.
Input (Form fields)
{ 'id': number, 'phone': number }
Output (result)
{
"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
}
Libraries and tools
- Node.js
- Express.js
- axios
- form-data
- jsdom
Todo
- 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
Installation
npm install
or
yarn install
Development
You can use the development server (with nodemon) by running:
npm run dev
or
yarn dev
Open http://localhost:3000 with your browser to see the result.
Running
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".
Testing
curl --location --request POST 'https://elux-api.herokuapp.com' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "YOUR_REGISTERED_ID_NUM",
"phone": "352681000000"
}'