Skip to content

Given the URL of the page, list all the images that are being used and allow the user to download them.

License

Notifications You must be signed in to change notification settings

lauti7/image-extractor-api

Repository files navigation

Image Extractor - API Build Status

API for Image Extractor - Client

Given the URL of the page, list all the images that are being used and allow the user to download them.

API is online here and its browser client is online here

Built with:

Typescript, Express, and Cheerio (will be replaced for Puppeteer). I am using TravisCI for CI/CD

API allows user to:

  • Get all images from any public website (server side render).
  • Download an image from its link

API:

Get all images links from website

Request

POST /api/extract/

Response

Array of links

{"images": []}

Download single image

Request

GET /api/download/single?weburl={IMAGE_LINK}

Response

Returns the image. If you make a request from your browser, the image will be displayed.

In order to force downloading:

Request

GET /api/download/single?weburl={IMAGE_LINK}&forceDownload=true

Response

Image will be automatically downloaded.

Instalation

You should have Node JS and NPM installed on your PC.

git clone https://github.com/lauti7/image-extractor-api.git
cd image-extractor-api
npm install
touch .env

vim .env

NODE_ENV=development
PORT={YOUR_PORT}

TODOs:

  • Replace Cheerio for Puppeteer.
  • Support for client side render sites.
  • Add endpoints for downloading scrapped images.
  • Allow users to download an optimized version of each scrapped image.
  • Add tests.
  • Add Redis cache.
  • Dockerize it.

About

Given the URL of the page, list all the images that are being used and allow the user to download them.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages