MetaFetch is a lightweight Go-based API that fetches and returns metadata from any URL in the oEmbed format. It’s built using the blazing-fast Gin framework and GoQuery to fetch the page metadata.
- 🚀 Fast & Lightweight – Powered by Go and the Gin framework.
- 🌍 oEmbed Compliant – Outputs metadata in standard oEmbed JSON format.
- 📦 Dockerized – Easily deploy MetaFetch anywhere using Docker.
- ⚡ Extensible – Add more metadata fields or customize the response format.
- Go 1.20+ (if running locally)
- Docker (for containerization)
- A basic understanding of HTTP APIs
To run the project locally, you can build and run it using Go:
-
Clone the repository:
git clone https://github.com/joshghent/metafetch.git cd metafetch
-
Install the dependencies:
go mod tidy
-
Run the application:
go run main.go
-
Access the API at
http://localhost:8080/oembed?url=<page_url>
, replacing<page_url>
with a valid URL.
MetaFetch is Dockerized for easy deployment. To build and run the Docker container:
-
Build the Docker image:
docker build -t metafetch .
-
Run the Docker container:
docker run -p 8080:8080 metafetch
-
Access the API at
http://localhost:8080/oembed?url=<page_url>
.
MetaFetch is also available via the GitHub Container Registry. To pull the latest image:
docker pull ghcr.io/joshghent/metafetch:latest
You can use MetaFetch to extract metadata from any publicly accessible URL. Simply make a GET request to the /oembed endpoint with the URL as a query parameter.
Example Request:
GET /oembed?url=https://example.com
Example Response:
{
"version": "1.0",
"type": "link",
"title": "Example Page Title",
"author_name": "John Doe",
"author_url": "https://example.com/author",
"provider_name": "example.com",
"provider_url": "https://example.com",
"thumbnail_url": "https://example.com/thumbnail.jpg"
}
This project uses GitHub Actions for continuous integration and deployment. The Docker image is automatically built and pushed to the GitHub Container Registry on every push to the main branch.
Contributions are welcome! To get started:
- Fork the repository.
- Create a new feature branch (
git checkout -b feature/your-feature
). - Make your changes.
- Push to your branch and open a pull request.