Neynar Documentation

Embedded URL metadata

cURL

curl --request GET \
  --url https://api.neynar.com/v2/farcaster/cast/embed/crawl/ \
  --header 'x-api-key: NEYNAR_API_DOCS'

Python

import requests

url = "https://api.neynar.com/v2/farcaster/cast/embed/crawl/"

headers = {"x-api-key": "NEYNAR_API_DOCS"}

response = requests.get(url, headers=headers)

print(response.text)

JavaScript

const options = {method: 'GET', headers: {'x-api-key': 'NEYNAR_API_DOCS'}};

fetch('https://api.neynar.com/v2/farcaster/cast/embed/crawl/', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.neynar.com/v2/farcaster/cast/embed/crawl/",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-api-key: NEYNAR_API_DOCS"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
?>

Go

package main

import (
    "fmt"
    "net/http"
    "io"
)

func main() {

url := "https://api.neynar.com/v2/farcaster/cast/embed/crawl/"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-api-key", "NEYNAR_API_DOCS")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))
}

Unirest (Java)

HttpResponse<String> response = Unirest.get("https://api.neynar.com/v2/farcaster/cast/embed/crawl/")
  .header("x-api-key", "NEYNAR_API_DOCS")
  .asString();

Ruby

require 'uri'
require 'net/http'

url = URI("https://api.neynar.com/v2/farcaster/cast/embed/crawl/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = 'NEYNAR_API_DOCS'

response = http.request(request)
puts response.read_body

Responses

Metadata Response

{
  "metadata": {
    "_status": "<string>",
    "content_length": 123,
    "content_type": "<string>",
    "frame": {
      "frames_url": "<string>",
      "image": "<string>",
      "version": "<string>",
      "buttons": [
        {
          "index": 123,
          "post_url": "<string>",
          "target": "<string>",
          "title": "<string>"
        }
      ],
      "image_aspect_ratio": "<string>",
      "input": {
        "text": "<string>"
      },
      "post_url": "<string>",
      "state": {
        "serialized": "<string>"
      },
      "title": "<string>"
    },
    "html": {
      "favicon": "<string>",
      "modifiedTime": "<string>",
      "oembed": {
        "html": "<string>",
        "type": "rich",
        "version": "<string>",
        "author_name": "<string>",
        "author_url": "<string>",
        "cache_age": "<string>",
        "height": 123,
        "provider_name": "<string>",
        "provider_url": "<string>",
        "thumbnail_height": 123,
        "thumbnail_url": "<string>",
        "thumbnail_width": 123,
        "title": "<string>",
        "width": 123
      },
      "ogArticleAuthor": "<string>",
      "ogArticleExpirationTime": "<string>",
      "ogArticleModifiedTime": "<string>",
      "ogArticlePublishedTime": "<string>",
      "ogArticlePublisher": "<string>",
      "ogArticleSection": "<string>",
      "ogArticleTag": "<string>",
      "ogAudio": "<string>",
      "ogAudioSecureURL": "<string>",
      "ogAudioType": "<string>",
      "ogAudioURL": "<string>",
      "ogAvailability": "<string>",
      "ogDate": "<string>",
      "ogDescription": "<string>",
      "ogDeterminer": "<string>",
      "ogEpisode": "<string>",
      "ogImage": [
        {
          "url": "<string>",
          "alt": "<string>",
          "height": "<string>",
          "type": "<string>",
          "width": "<string>"
        }
      ],
      "ogLocale": "<string>",
      "ogLocaleAlternate": "<string>",
      "ogLogo": "<string>",
      "ogMovie": "<string>",
      "ogPriceAmount": "<string>",
      "ogPriceCurrency": "<string>",
      "ogProductAvailability": "<string>",
      "ogProductCondition": "<string>",
      "ogProductPriceAmount": "<string>",
      "ogProductPriceCurrency": "<string>",
      "ogProductRetailerItemId": "<string>",
      "ogSiteName": "<string>",
      "ogTitle": "<string>",
      "ogType": "<string>",
      "ogUrl": "<string>",
      "ogVideo": [
        {
          "url": "<string>",
          "height": "<string>",
          "type": "<string>",
          "width": "<string>"
        }
      ],
      "ogVideoActor": "<string>",
      "ogVideoActorId": "<string>",
      "ogVideoActorRole": "<string>",
      "ogVideoDirector": "<string>",
      "ogVideoDuration": "<string>",
      "ogVideoOther": "<string>",
      "ogVideoReleaseDate": "<string>",
      "ogVideoSecureURL": "<string>",
      "ogVideoSeries": "<string>",
      "ogVideoTag": "<string>",
      "ogVideoTvShow": "<string>",
      "ogVideoWriter": "<string>",
      "ogWebsite": "<string>",
      "updatedTime": "<string>"
    },
    "image": {
      "height_px": 123,
      "width_px": 123
    },
    "video": {
      "duration_s": 123,
      "stream": [
        {
          "codec_name": "<string>",
          "height_px": 123,
          "width_px": 123
        }
      ]
    }
  }
}

Error Response

{
  "message": "<string>",
  "code": "<string>",
  "property": "<string>",
  "status": 123
}