The eKamus API is a web scraping API designed to provide translation and definition services from Bahasa Malaysia (BM) to Chinese (CN) languages. This API scrapes data from the Ekamus website to retrieve word definitions and translations. Developers can utilize this API to integrate Bahasa Malaysia dictionary functionality into their applications.
API LIVE URL: https://ekamusapi.manho.xyz
Table of Contents
To use the BM-CN Dictionary API, you'll need the following:
- Node.js (version x.x.x or higher)
- npm or yarn package manager
- Clone this repository to your local machine.
- Navigate to the project directory using your terminal.
- Install the required dependencies using either npm or yarn:
npm install # or yarn install
During development, you can run the API server locally:
- Ensure you're in the project directory.
- Start the API server: npm run dev
The API will be accessible at http://localhost:YOUR_PORT
.
The API exposes the following endpoint:
GET /search
The /search
endpoint supports the following query parameter:
q
: The word or phrase to search for in the dictionary.
You can easily deploy the BM-CN Dictionary API to Vercel:
- Sign up for an account on Vercel if you haven't already.
- Install the Vercel CLI
npm install -g vercel
- Navigate to your project directory.
- Deploy your API using Vercel:
vercel
- Follow the prompts and configure your deployment settings.
After successful deployment, your API will be accessible via the provided Vercel URL.
Examples
Here's an example of how to use the API:
GET /search?q=example
Response:
{
"ok": true,
"status": 200,
"data": {
"word": [
{
"bm": "kerja amali",
"cn": "实践工作"
},
{
"bm": "kerja amal",
"cn": "慈善或义务工作"
},
...
],
"meanings": [
"工作﹐操作﹐劳动"
]
}
}
We welcome contributions to the BM-CN Dictionary API. If you have suggestions for improvements, bug reports, or would like to add new features, feel free to submit a pull request.
Please read our Contribution Guidelines for more information.
This project is licensed under the MIT License.
Disclaimer: This documentation is provided as a template. You should tailor it to your project's specific details and requirements.