Graph API Version

Location

Location node used with other objects in the Graph API.

Reading

A location

Examples

Graph API Explorer
GET v2.9/...?fields={fieldname_of_type_Location} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '...?fields={fieldname_of_type_Location}'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "...?fields={fieldname_of_type_Location}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "...?fields={fieldname_of_type_Location}",
    null,
    HttpMethod.GET,
    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:@"...?fields={fieldname_of_type_Location}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
If you want to learn how to use the Graph API, read our Using Graph API guide.

Parameters

This endpoint doesn't have any parameters.

Fields

FieldDescription

city

string

City

city_id

unsigned int32

City ID. Any city identified is also a city you can use for targeting ads.

country

string

Country

country_code

string

Country code

latitude

float

Latitude

located_in

id

The parent location if this location is located within another location

longitude

float

Longitude

name

string

Name

region

string

Region

region_id

unsigned int32

Region ID. Specifies a geographic region, such as California. An identified region is the same as one you can use to target ads.

state

string

State

street

string

Street

zip

string

Zip code

Edges

No edges

Creating

You can make a POST request to locations edge from the following paths:
When posting to this edge, a Location will be created.

Parameters

NameDescription
always_open
boolean

Indicates whether this location is always open

hours
dictionary { string : <> }

Hours for this store. Please see the format for hours in our page documentation for examples

ignore_warnings
boolean

Whether to disable any warnings (not errors) that result from this API call, such as latitude and longitude not matching street address

location
Object

This defines the location for this page. This is required if the Page referenced by the location_page_id doesn't have a valid value for the field. The dictionary must include the keys street (street address), and either city_id or all of city, state, and country (but state is optional if the address is not in the U.S.). The zip is required for addresses in countries with postal codes. If Facebook isn't able to geocode the address, you must also include latitude and longitude.

street
string
city
string
state
string
country
string
zip
string
city_id
city id
latitude
float
longitude
float
location_page_id
Page ID

The ID of the Facebook Page you would like to add or update as a location

old_store_number
int64

Old store number. Used when you want to change the store number for a location

page_username
string

Vanity URL for this location. This has to be an unused vanity URL. You should check by querying /{page-username} and looking for existing objects with this name

permanently_closed
boolean

Is this location permanently closed?

phone
string

Phone number for this location. This is required if the Page referenced by the location_page_id doesn't have a valid phone.

place_topics
list<numeric string>

Place topics for this location. This is required if the Page referenced by the location_page_id doesn't have a valid place_topic. Use an array of IDs sourced from the placetopic search endpoint

price_range
string

Price range of the business. Applicable to Restaurants or Nightlife. Can be one of $, $$, $$$, $$$$ or Unspecified

store_location_descriptor
string

Location descriptor for this store. This will appear after the Page name and should only be used if the location has a special location that's not clear from its city or street address. e.g. if it's inside a shopping mall or if it's best identified by its neighborhood

store_name
string

The store name

store_number
int64

An arbitrary, developer-defined ID for this location, usually used to link back to an internal database of locations

Required
website
URL

The URL of the location's website

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.