Graph API Version

URL /?id={url}

Represents a URL shared on a timeline or in a comment.

Reading

Get fields on a URLNode.

Requirements

  • Any access token can be used to make this request.

Example Request

curl -i -X GET \
  "https://graph.facebook.com/{version}/?id={url}&access_token={access-token}"

Example Response

{
  "id": "{url}"
}

Fields

Property Name Description Type

app_links

AppLinks data associated with this URL, if available.

AppLinks

id

The URL itself.

string

engagement

Counts of different ways people interacted with the URL.

object

comment_count

Number of comments on the URL.

int

comment_plugin_count

Number of comments on the plugin gathered using the Comments Plugin on your site.

int

reaction_count

Number of reactions to the URL.

int

share_count

Number of times the URL was shared.

int

og_object

The Open Graph object that is canonically associated with this URL.

OGObject

id

ID of object.

string

description

The description of the object, if available.

string

title

The title of the object, if available.

string

type

The object type.

og:type

updated_time

When the object was last updated.

datetime

Example Request

Graph API Explorer
GET v4.0/?id=https://www.facebook.com?fields=engagment HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '?id=https://www.facebook.com',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "?id=https://www.facebook.com",
    {
        "fields": "engagment"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("fields", "engagment");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "?id=https://www.facebook.com",
    params,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
NSDictionary *params = @{
  @"fields": @"engagment",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"?id=https://www.facebook.com"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Example Response

{
  "engagement": {
    "reaction_count": 514919172,
    "comment_count": 68687082,
    "share_count": 975739682,
    "comment_plugin_count": 1641
  },
  "id": "https://www.facebook.com"
}

Publishing

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.

Updating

Update a URL.

Requirements

  • Any access token can be used to make this request.
  • The URL must be encoded so that it does not interfere with the scrape parameter.

Example Request

curl -i -X POST \
  "https://graph.facebook.com/{version}/?id={url}&scrape=true&access_token={access-token}"

Example Response

{
  "success": true
}