This document refers to an outdated version of Graph API. Please use the latest version.
Graph API Version

URL /?id={url}

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

Reading

Get fields on a URLNode.

Requirements

TypeDescription
Access Tokens

Any access token can be used to make this request.

Features

Not applicable.

Page Tasks

Not applicable.

Permissions

Not applicable.

Example Request

GET /{version}/?id={url} HTTP/1.1
Host: graph.facebook.com

Example Response

{
  "id": "{url}"
}

Query String Parameters

Include the following query string parameters to augment the request.

ParameterDescription

access_token

Required

string

An access token.

fields

string

A comma-separated list of fields you want to request.

id

string

The url to be shared.

scopes

string

A comma-separated list of scopes.

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 v5.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?fields=engagment',
    '{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"
}

Creating

Create fields on a URLNode.

Requirements

TypeDescription
Access Tokens

Any access token can be used to make this request.

Features

Not applicable.

Page Tasks

Not applicable.

Permissions

Not applicable.

Example Request

POST /{version}/?id={url} HTTP/1.1
Host: graph.facebook.com

Example Response

{
  "id": "{url}"
}

Query String Parameters

Include the following query string parameters to augment the request.

ParameterDescription

access_token

Required

string

An access token.

blacklist

boolean

Add or remove a URL to the News Tab blacklist. Set to true to add or false to remove.

id

Required

string

The url to be shared.

scopes

string

A comma-separated list of scopes. Possible values: news_tab

Example Request

Graph API Explorer
POST v5.0/?id=https://www.facebook.com&scopes=news_tab HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '?id=https://www.facebook.com&scopes=news_tab',
    array (),
    '{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&scopes=news_tab",
    "POST",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "?id=https://www.facebook.com&scopes=news_tab",
    null,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"?id=https://www.facebook.com&scopes=news_tab"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Example Response

{
  "success": true
}

Updating

Update a URL.

Requirements

TypeDescription
Access Tokens

Any access token can be used to make this request.

Features

Not applicable.

Page Tasks

Not applicable.

Permissions

Not applicable.

Example Request

POST /{version}/?id={url}&scrape=true HTTP/1.1
Host: graph.facebook.com

Example Response

{
  "success": true
}  

Query String Parameters

Include the following query string parameters to augment the request.

ParameterDescription

access_token

Required

string

An access token.

fields

string

A comma-separated list of fields you want to request.

id

Required

string

The url to be updated. The url must be encoded so that it does not interfere with the scrape parameter.

scrape

Required

boolean

Value must be true.

Example Request

POST /{version}/?id={url}&scrape=true
Host: graph.facebook.com

Example Response

{
  "success": true
}

Deleting

You can't perform this operation on this endpoint.