Skip to content

rosvik/og.248.no

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

og.248.no

A simple Rust-based API that pulls Open Graph data from a given URL. It works by fetching the HTML content of the URL and returning the values of any Open Graph meta tags. There is a built in cache, which makes it blazingly fast to fetch the same URL multiple times.

A hosted version is available at https://og.248.no.

How to Use

Setup

cargo run

The API will start running on http://127.0.0.1:2340.

Usage

Fetch data by making an API call on this format:

GET /api?url=<URL>

The response will be a JSON formatted array with pairs of property and content.

Array<{
  property: string;
  content: string;
}>

Example

Using the URL for this GitHub repository as an example:

GET https://og.248.no/api?url=https://github.com/rosvik/og.248.no

[
  {
    "property": "twitter:image",
    "content": "https://opengraph.githubassets.com/3237a9a882e420d99c3e74a10d9386e5bdce72efe8f025e37e0317833a47629d/rosvik/og.248.no"
  },
  {
    "property": "twitter:site",
    "content": "@github"
  },
  {
    "property": "twitter:card",
    "content": "summary_large_image"
  },
  {
    "property": "twitter:title",
    "content": "GitHub - rosvik/og.248.no: Get Open Graph data from a given URL"
  },
  {
    "property": "twitter:description",
    "content": "Get Open Graph data from a given URL. Contribute to rosvik/og.248.no development by creating an account on GitHub."
  },
  {
    "property": "og:image",
    "content": "https://opengraph.githubassets.com/3237a9a882e420d99c3e74a10d9386e5bdce72efe8f025e37e0317833a47629d/rosvik/og.248.no"
  },
  {
    "property": "og:image:alt",
    "content": "Get Open Graph data from a given URL. Contribute to rosvik/og.248.no development by creating an account on GitHub."
  },
  {
    "property": "og:image:width",
    "content": "1200"
  },
  {
    "property": "og:image:height",
    "content": "600"
  },
  {
    "property": "og:site_name",
    "content": "GitHub"
  },
  {
    "property": "og:type",
    "content": "object"
  },
  {
    "property": "og:title",
    "content": "GitHub - rosvik/og.248.no: Get Open Graph data from a given URL"
  },
  {
    "property": "og:url",
    "content": "https://github.com/rosvik/og.248.no"
  },
  {
    "property": "og:description",
    "content": "Get Open Graph data from a given URL. Contribute to rosvik/og.248.no development by creating an account on GitHub."
  }
]
248

About

Get Open Graph data from a given URL

Topics

Resources

Stars

Watchers

Forks

Contributors