Skip to content

Instantly share code, notes, and snippets.

@techforum-repo
Last active May 17, 2021 00:53
Show Gist options
  • Save techforum-repo/4fe6320960d5823a220149449491a096 to your computer and use it in GitHub Desktop.
Save techforum-repo/4fe6320960d5823a220149449491a096 to your computer and use it in GitHub Desktop.

Facebook oEmbed API Reference

Get Page Embed - Client Access Token

curl -i -X GET "https://graph.facebook.com/v10.0/oembed_page?url={Page URL}&access_token={APP ID}|{Client Access Token}"
e.g. curl -i -X GET "https://graph.facebook.com/v10.0/oembed_page?url=https%3A%2F%2Fwww.facebook.com%2Ftechlogyforum&access_token=191545172686279|c98f87ecec83d6183004602be86410d7"

Get Video Embed

curl -i -X GET "https://graph.facebook.com/v10.0/oembed_video?url={Video URL}&access_token={APP ID}|{Client Access Token}"
curl -i -X GET "https://graph.facebook.com/v10.0/oembed_video?url=https%3A%2F%2Fwww.facebook.com%2F746037862104519%2Fvideos%2F308019210113515&access_token=191545172686279|c98f87ecec83d6183004602be86410d7"

Get Post Embed - Client Access Token

curl -i -X GET "https://graph.facebook.com/v10.0/oembed_post?url={Post URL}&access_token={APP ID}|{Client Access Token}"
e.g. curl -i -X GET "https://graph.facebook.com/v10.0/oembed_post?url=https%3A%2F%2Fwww.facebook.com%2Ftechlogyforum%2Fposts%2F5112729285435333&access_token=191545172686279|c98f87ecec83d6183004602be86410d7"

Get Page/Video/Post Embed - APP Token

Get APP Token

curl -X GET "https://graph.facebook.com/oauth/access_token?client_id={APP ID}&client_secret={APP Secret}&grant_type=client_credentials"

e.g curl -X GET "https://graph.facebook.com/oauth/access_token?client_id=191545172686279&client_secret=716cb7aac29163f2d9c56279d95b454c&grant_type=client_credentials"

Get Embeds

curl -i -X GET "https://graph.facebook.com/{api-endpoint}&access_token={APP Token}"

e.g. curl -i -X GET "https://graph.facebook.com/v10.0/oembed_post?url=https%3A%2F%2Fwww.facebook.com%2Ftechlogyforum%2Fposts%2F5112729285435333&access_token=191545172686279|ZR5NOCESJQHqvRaPu6eFrd4_6c0"

Get Embeds through APP ID/APP Secret

curl -i -X GET "https://graph.facebook.com/{api-endpoint}&access_token={your-app_id}|{your-app_secret}"

e.g. curl -i -X GET "https://graph.facebook.com/v10.0/oembed_post?url=https%3A%2F%2Fwww.facebook.com%2Ftechlogyforum%2Fposts%2F5112729285435333&access_token=191545172686279|716cb7aac29163f2d9c56279d95b454c"

Get Embed through Authorization Header

curl -i -X GET "https://graph.facebook.com/{api-endpoint} --header "Authorization: Bearer Client/App Access Token"

e.g. 
curl -i -X GET "https://graph.facebook.com/v10.0/oembed_page?url=https%3A%2F%2Fwww.facebook.com%2Ftechlogyforum" --header "Authorization: Bearer 2838278549820949|ce86514d129f6252aeeb46ef1ea288f5"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment