https://github.com/rosvik/og.248.no
Get Open Graph data from a given URL
https://github.com/rosvik/og.248.no
opengraph
Last synced: 6 months ago
JSON representation
Get Open Graph data from a given URL
- Host: GitHub
- URL: https://github.com/rosvik/og.248.no
- Owner: rosvik
- Created: 2024-04-13T18:54:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-12-25T21:03:42.000Z (6 months ago)
- Last Synced: 2025-12-27T07:14:19.175Z (6 months ago)
- Topics: opengraph
- Language: Rust
- Homepage: https://og.248.no
- Size: 76.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# og.248.no
A simple Rust-based API that pulls [Open Graph](https://ogp.me/) 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](https://og.248.no).
## How to Use
### Setup
```bash
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=`
The response will be a JSON formatted array with pairs of `property` and `content`.
```ts
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
```json
[
{
"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."
}
]
```