SEM Ad Landing URL API Documentation

Introduction

This API allows SEM systems to query the site to get URLs generated according to the current URL conventions.

  • Make a POST to the https://www.cargurus.com/Cars/api/1.0/semUrlGenerator.action URL specifying the parameters described below
  • Retrieve and process the response which will be a JSON string representing the SemUrlResponse object also described below.

HTTP Request

URL https://www.cargurus.com/Cars/api/1.0/semUrlGenerator.action
Method POST
Parameters
Name Description Object Type
appId The application id - provided by CarGurus string
authToken The authentication token - provided by CarGurus string
body JSON representation of the SemUrlRequest object described below which contains the type of landing url to generate along with any required parameters (e.g. locale) SemUrlRequest object

SemUrlRequest Body JSON Fields

Name Description Object Type
url_type
Value Description Parameters
NEW_CAR
NEW_CAR_NO_PRODUCT
New Inventory URL Generator entity_id
location_id
parameters
USED_CAR
USED_CAR_WITH_GEO
USED_CAR_NO_PRODUCT
Used Inventory URL Generator entity_id
location_id
parameters
CERTIFIED_CAR CPO Car URL Generator entity_id
location_id
USED_CAR_SEARCH Generate a URL to the Used Car SRP.
SEO_PAGE_TYPE Generate a canonical URL. Include the desired page type in the seo_page_type parameter to be one of:
  • spt-cars-under-10k
  • spt-sleeper-cars
  • spt-lifted-gmc-trucks
  • spt-american-made-trucks
  • spt-fc3s-rx7
  • spt-4x4-trucks
  • spt-s14-silvia
  • spt-best-cars-over-40-mpg
  • spt-best-mpg-convertibles
  • spt-electric-cars-under-10k
  • spt-fzj80-land-cruiser
  • spt-free-home-drop-off
  • spt-electric-wagons
  • spt-genesis-electric-cars
  • spt-dually-trucks
  • spt-cheap-manual-cars
  • spt-electric-cars
  • spt-cars-under-40000
  • spt-best-mpg-hybrids
  • spt-audi-electric-cars
  • spt-single-cab-trucks
  • spt-hyundai-electric-cars
  • spt-used-cars
  • spt-great-deals
  • spt-cheap-muscle-cars
  • spt-white-suvs-crossovers
  • spt-electric-cars-under-25000
  • spt-best-gas-mileage-suvs
  • spt-cars-under-1500
  • spt-rwd-manual-cars
  • spt-best-3-row-suv
  • spt-lifted-trucks
  • spt-audi-coupes
  • spt-ford-trucks
  • spt-mazda-miata-1990-to-1997
  • spt-electric-cargo-vans
  • spt-three-quarter-ton-trucks
  • spt-best-mpg-wagons
  • spt-convertibles-under-40000
  • spt-ford-mustang-convertibles
  • spt-tesla-electric-cars
  • spt-ford-electric-cars
  • spt-best-family-sedans
  • spt-sports-cars-under-20k
  • spt-cheap-small-cars
  • spt-electric-cars-under-20000
  • spt-fuel-efficient-cars
  • spt-manual-diesel-trucks
  • spt-lifted-diesel-trucks
  • spt-manual-transmission-trucks
  • spt-cheap-vans
  • spt-cars-under-20k
  • spt-used-honda-civic-under-3000
  • spt-coupes-under-40000
  • spt-electric-sedans
  • spt-best-trucks
  • spt-obs-ford-trucks
  • spt-manual-transmission-cars
  • spt-cheap-cars
  • spt-lifted-ford-trucks
  • spt-hybrid-suv
  • spt-best-mpg-cars
  • spt-best-mpg-trucks
  • spt-dodge-trucks
  • spt-c3-corvette
  • spt-over-9000
  • spt-best-mpg-coupes
  • spt-c4-corvette
  • spt-nissan-electric-cars
  • spt-mini-convertibles
  • spt-third-row-suvs
  • spt-one-ton-trucks
  • spt-conversion-van
  • spt-bmw-electric-cars
  • spt-electric-hatchbacks
  • spt-cars-under-50000
  • spt-wheelchair-accessible
  • spt-jaguar-electric-cars
  • spt-cars-under-4000
  • spt-cheap-nissan-gt-r
  • spt-electric-cars-under-50000
  • spt-kia-suvs-crossovers
  • spt-manual-suv
  • spt-classic-trucks
  • spt-best-cheap-cars
  • spt-most-reliable-car-brands
  • spt-panther-platform-fords
  • spt-green-cars
  • spt-convertibles-under-50000
  • spt-lifted-ram-trucks
  • spt-toyota-sedans
  • spt-lexus-coupes
  • spt-small-cars
  • spt-chevrolet-trucks
  • spt-best-mpg-sedans
  • spt-new-cars-under-20k
  • spt-honda-suvs-crossovers
  • spt-4x4-trucks-under-5000
  • spt-toyota-electric-cars
  • spt-project-cars
  • spt-classic-ford-trucks
  • spt-coupes-under-50000
  • spt-trucks-under-9000
  • spt-used-jeep-wrangler-under-5000
  • spt-cheap-hybrid-cars
  • spt-obs-trucks
  • spt-reliable-cars
  • spt-muscle-cars
  • spt-diesel-trucks
  • spt-small-trucks
  • spt-cheap-old-trucks
  • spt-cars-under-60000
  • spt-best-cars-in-snow
  • spt-cheap-suvs
  • spt-celebrity-cars
  • spt-ford-suvs-crossovers
  • spt-toyota-trucks
  • spt-mercedes-benz-c-class-coupe
  • spt-cars-under-5000
  • spt-fiat-electric-cars
  • spt-free-home-test-drive
  • spt-cheap-mustangs
  • spt-classic-cars
  • spt-trucks-under-3000
  • spt-luxury-cars
  • spt-used-jeep-wrangler-under-15000
  • spt-electric-pickup-trucks
  • spt-hyundai-performance
  • spt-used-honda-civic-under-5000
  • spt-black-tacoma
  • spt-4x4-trucks-under-10k
  • spt-family-cars
  • spt-old-toyota-trucks
  • spt-smart-electric-cars
  • spt-electric-cars-under-15000
  • spt-chevrolet-electric-cars
  • spt-awd-cars
  • spt-electric-convertibles
  • spt-voltswagen-electric-cars
  • spt-hybrid-cars
  • spt-mk4-supra
  • spt-subaru-electric-cars
  • spt-kia-electric-cars
  • spt-lifted-chevrolet-trucks
  • spt-jeep-suv-crossovers
  • spt-used-jeep-wrangler-under-10000
  • spt-cars-under-30000
  • spt-cars-with-online-financing
  • spt-volkswagen-electric-cars
  • spt-classic-nsx
  • spt-ford-diesel-trucks
  • spt-bmw-convertibles
  • spt-awd-electric-cars
  • spt-coupes-under-60000
  • spt-bmw-coupes
  • spt-lucid-electric-cars
  • spt-lexus-suvs-crossovers
  • spt-bmw-manual
  • spt-air-cooled-porsches
  • spt-best-minivans
  • spt-best-small-suvs-crossovers-user-rankings
  • spt-rivian-electric-cars
  • spt-convertibles-under-60000
  • spt-electric-cars-under-40000
  • spt-best-cars-over-30-mpg
  • spt-cars-under-70000
  • spt-electric-cars-under-5000
  • spt-best-mpg-diesel-cars
  • spt-reliable-cheap-cars
  • spt-best-used-cars-under-5000
  • spt-fast-and-furious-9-cars
  • spt-chevrolet-camaro-convertible
  • spt-gmc-electric-cars
  • spt-cheap-supercars
  • spt-volvo-electric-cars
  • spt-electric-suvs
  • spt-best-full-size-luxury-sedans-user-rankings
  • spt-old-chevrolet-trucks
  • spt-old-4x4-trucks
  • spt-awd-suvs
  • spt-porsche-electric-cars
  • spt-cars-under-15000
  • spt-trucks-under-7000
  • spt-cheap-lamborghinis
  • spt-sports-cars
  • spt-polestar-electric-cars
  • spt-cheap-electric-cars
  • spt-toyota-suvs-crossovers
  • spt-work-trucks
  • spt-nissan-suvs-crossovers
  • spt-supercars
  • spt-chevrolet-diesel-trucks
  • spt-jaguar-suvs-crossovers
  • spt-cars-under-20000
  • spt-affordable-luxury-cars
  • spt-convertibles-under-30000
  • spt-best-used-suvs
  • spt-best-american-muscle-cars
  • spt-red-interior
  • spt-ford-flex-fuel
  • spt-hybrid-sedans
  • spt-cg-guarantee
  • spt-black-exterior-red-interior
  • spt-honda-sedans
  • spt-mini-electric-cars
  • spt-chevrolet-suvs-crossovers
  • spt-infiniti-coupes
  • spt-1980s-trucks
  • spt-fox-body-mustang
  • spt-best-mpg-hatchbacks
  • spt-cheap-trucks
  • spt-mercedes-benz-electric-cars
  • spt-new-cars-under-15k
  • spt-bmw-e36-3-series
  • spt-cars-under-2000
  • spt-used-honda-civic-under-10000
  • spt-cheap-automatic-transmission
  • spt-electric-cars-under-30000
  • spt-gm-certified-preowned
location_id
seo_page_type
DEALER_SIGNUP Generate URL for the dealer signup page
RESEARCH_OVERVIEW Generate URL for the reasearch page entity_id
SELL_YOUR_OWN Generate URL for the private listing / sell your car page entity_id
string
locale a java locale string for the required country and language. e.g. es_US. Required/valid for all url_type's string
parameters Used by NEW_CAR and USED_CAR SRP URLs to filter results
Name Object Type Description
min_price long
max_price long
min_mileage long
max_mileage long
min_co2_emission long
max_co2_emission long
location_id long
start_year integer
end_year integer
min_mpg integer
max_mpg integer
min_engine_displacement double
max_engine_displacement double
days_on_market_min short
days_on_market_max short
latitude float
longitude float
hide_fleet boolean
hide_frame_damage boolean
hide_lemon boolean
hide_multiple_owners boolean
hide_salvage boolean
hide_theft boolean
hide_without_photos boolean
is_automatic_transmission boolean
price_drops_only boolean
entity_id string
locale string
zip string
distance string
engine_displacements array of strings Valid values can be enumerated with the Filter Values API
new_used_criteria array of integers 1 = NEW
2 = USED
3 = CPO
seatings array of integers Valid values can be enumerated with the Filter Values API
wheel_systems array of strings Valid values can be enumerated with the Filter Values API
body_styles array of longs
installed_option_ids array of longs Valid values can be enumerated with the Filter Values API
colors array of strings external color
Valid values can be enumerated with the Filter Values API
engines array of strings Valid values can be enumerated with the Filter Values API
seller_types array of strings:'PRIVATE' or 'DEALER'
advanced_search_auto_entities array of strings
object

HTTP Response

The API returns a JSON formatted string representing an SemUrlResponse object described below.

SemUrlResponse Fields

Name Description Object Type
success Whether the request was processed successfully. This flag describes the overall status of the request. If success is false, then the error object described below will contain the appropriate error code and description. boolean (true/false)
error An ApiError object containing a specific error code and description ApiError object
url The landing url for the given request string

ApiError Fields

Name Description Object Type
error_code The error code integer
description The error's description string

Error Codes

  • 101 - the locale given on the request is not yet implemented or is invalid
  • 102 - the given request data is valid, but the system was unable to generate an url
  • 103 - the given entity id was not able to be found in the database
  • 104 - the given location id was not able to be found in the database
  • 105 - the given data items in the request are not supported. e.g. cheap cars url given a specific entity id

Examples

Example 1 - (Valid Request)

HTTP Request's 'body' parameter:

  {
  "url_type": "CHEAP_USED_CARS",
  "locale": "en_US"
  }

HTTP Response

  {
  "success": true,
  "url": "https://www.cargurus.com/Cars/spt-cheap-cars"
  }

Example 2 - (Request with Parameters)

HTTP Request's 'body' parameter:

  {
  "url_type": "USED_CAR",
  "locale": "en_US",
  "parameters":
      {
      "location_id": 5
      }
  }

HTTP Response

  {
  "success":true,
  "url":"https://www.cargurus.com/Cars/spt-used-cars-Jefferson_L5"
  }

Example 3 - (Invalid Request)

HTTP Request's 'body' parameter:

  {
  "url_type": "CHEAP_USED_CARS",
  "locale": "fr_US"
  }

HTTP Response

  {
  "success": false,
  "error":
      {
      "description": "Unsupported application locale fr_US",
      "error_code": 101
      }
  }

Example 4 - (Valid Request)

HTTP Request's 'body' parameter:

        {
        "url_type": "SEO_PAGE_TYPE",
        "seo_page_type": "spt-cheap-cars"
        "locale": "en_US"
        }

HTTP Response

        {
        "success": true,
        "url": "https://www.cargurus.com/Cars/spt-cheap-cars"
        }