Graph API Version

Product Catalog Vehicles

Reading

Retrieve vehicles from a product catalog.

Example

Graph API Explorer
GET /v19.0/{product-catalog-id}/vehicles 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(
    '/{product-catalog-id}/vehicles',
    '{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(
    "/{product-catalog-id}/vehicles",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{product-catalog-id}/vehicles",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{product-catalog-id}/vehicles"
                                      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

ParameterDescription
bulk_pagination
boolean

Used for iterating over the edge in large chunks

filter
A JSON-encoded rule

JSON-encoded WCA rule expression representing the filter to be applied for the edge

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {}, "summary": {} }

data

A list of Vehicle nodes.

paging

For more details about pagination, see the Graph API guide.

summary

Aggregated information about the edge, such as counts. Specify the fields to fetch in the summary param (like summary=total_count).

FieldDescription
total_count
unsigned int32

Total number of vehicles returned by the query

Error Codes

ErrorDescription
100Invalid parameter

Creating

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

Parameters

ParameterDescription
address
JSON object

address

Required
city
string
Default value: ""

city

city_id
string

city_id

country
string
Default value: ""

country

latitude
float

latitude

longitude
float

longitude

neighborhoods
array<string>

neighborhoods

postal_code
string
Default value: ""

postal_code

region
string
Default value: ""

region

street_address
string
Default value: ""

street_address

applinks
Object

applinks

web

android

ios

ipad

iphone

windows_phone

availability
enum {AVAILABLE, NOT_AVAILABLE, PENDING}

availability

body_style
enum {CONVERTIBLE, COUPE, CROSSOVER, ESTATE, GRANDTOURER, HATCHBACK, MINIBUS, MINIVAN, MPV, PICKUP, ROADSTER, SALOON, SEDAN, SMALL_CAR, SPORTSCAR, SUPERCAR, SUPERMINI, SUV, TRUCK, VAN, WAGON, OTHER, NONE}

body_style

Required
condition
enum {EXCELLENT, VERY_GOOD, GOOD, FAIR, POOR, OTHER, NONE}

condition

currency
ISO 4217 Currency Code

currency

Required
date_first_on_lot
string

date_first_on_lot

dealer_id
string

dealer_id

dealer_name
string

dealer_name

dealer_phone
string

dealer_phone

description
string

description

Required
drivetrain
enum {TWO_WD, FOUR_WD, AWD, FWD, RWD, OTHER, NONE}

drivetrain

exterior_color
string

exterior_color

Required
fb_page_id
string

fb_page_id

fuel_type
enum {DIESEL, ELECTRIC, GASOLINE, FLEX, HYBRID, OTHER, PETROL, PLUGIN_HYBRID, NONE}

fuel_type

images
list<Object>

images

Required
image_url
URL

Required
tags
list<string>

interior_color
string

interior_color

make
string

make

Required
mileage
JSON object

mileage

Required
unit
enum {KILOMETERS, MILES}
Default value: "MILES"

unit

value
int64
Default value: 0

value

model
string

model

Required
price
int64

price

Required
state_of_vehicle
enum {NEW, USED, CPO}

state_of_vehicle

Required
title
string

title

Required
transmission
enum {AUTOMATIC, MANUAL, OTHER, NONE}

transmission

trim
string

trim

url
URI

url

Required
vehicle_id
string

vehicle_id

Required
vehicle_type
enum {BOAT, CAR_TRUCK, COMMERCIAL, MOTORCYCLE, OTHER, POWERSPORT, RV_CAMPER, TRAILER}

vehicle_type

vin
string

vin

Required
year
int64

year

Required

Return Type

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

Error Codes

ErrorDescription
100Invalid parameter
200Permissions error

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.