This project is an API that scrapes random memes from a website and serves them to the user. It uses Node.js and Express for the server-side logic and Axios for making HTTP requests.
Install my-project with npm.
- Clone this repository:
git clone https://github.com/bramireza/Meme-Scraper-API.git
- Install dependencies:
cd Meme-Scraper-API
npm install
- Crete a
.env
file in the root directory of the project with the following environment variables:
MEME_URL = http://www.quickmeme.com
- Start the server
npm run start
Endpoint | Method | Description |
---|---|---|
/api/v1/random-meme |
GET |
Returns a random meme image (JPEG) |
Endpoint | Method | Description |
---|---|---|
/api/v1/random-meme/listCategories |
GET |
Returns a list categories |
Endpoint | Method | Description |
---|---|---|
/api/v1/random-meme/tag/{tag} |
GET |
Returns a random meme image (JPEG) that matches the specified tag. |
To run this project, you will need to add the following environment variables to your .env file
PORT = YOUR-PORT-AVAILABLE
(Example: 8000
)
MEME_URL = http://www.quickmeme.com
GET /api/v1/random-meme
Returns a random meme image.
curl http://localhost:{YOUR-PORT}/api/v1/random-meme --output randomMeme.jpg
This will download a random meme image to a file named randomMeme.jpg
in the current directory.
GET /api/v1/random-meme/tag/{tag}
Returns a random meme image that matches the specified tag.
curl http://localhost:{YOUR-PORT}/api/v1/random-meme/tag/programming --output randomMeme.jpg
This will download a random meme image with the "programming" tag to a file named randomMeme.jpg
in the current directory.
Note: Replace "programming" with the desired tag.
Contributions are always welcome!
If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
https://meme-scraper-api.vercel.app/
<img src="https://meme-scraper-api.vercel.app/api/v1/random-meme/tag/programming"/>