Skip to content

2shrestha22/metapi

Repository files navigation

MetaPi

Web page meta extractor API. This is a simple express app that use Playwright as a headless browser and Metascraper to demonstrate extraction of meta tags from a web page. You can use this to create a link preview or extend the functionality to your need.

curl "localhost:3000?url=https://www.youtube.com/watch?v=IwYut9qF-jM"
{
  "title": "Why does hitting your funny bone feel so horrible? - Cella Wright",
  "author": "TED-Ed",
  "publisher": "YouTube",
  "image": "https://img.youtube.com/vi/IwYut9qF-jM/maxresdefault.jpg",
  "url": "https://www.youtube.com/watch?v=IwYut9qF-jM",
  "description": "Explore the complex anatomy of the elbow, and find out why hitting your funny bone causes such an odd and painful sensation."
}

Feature

  • Runs a headless browser to properly load web pages.
  • Set custom browser user agent.
  • Runs as non root user (for chromium sandbox).
  • Uses recommended seccomp profile.
  • Lightweight docker image.

Run

yarn run start

Develop

yarn run compile
yarn run start:watch

Build Docker Image

docker build -t metapi .

Run Docker Container

docker run -p 3000:3000 --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json metapi

Build and Run With Docker Compose

docker-compose up -d

About

Web page meta extractor API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published