Deal

This page will explain how to use the API to request deal data.


Request multiple deals

Use this to request multiple deals, only unexpired and active deals will be returned. Call this request using the GET http method, the results will be in JSON format.

Request URL

http://api.lucyvegas.com/client/v1/deal

Filter parameters

Use these options as query string variables to filter the request's results:

Variable Description
limit Limits the amount of deals returned. Must be an integer between 1 and 100. By default: 10.
skip Indicates how many deals must be skipped for the results, ideal for paging. Must be an integer. By default: 0.
title Search data by title similar to the filter's value.
location Search data by location. Address, City, State, Zip Code, Region or even country.
radius Search data by distance based on the location provided. The value must be a number and a location is required.
categorySlugs Search data by category. Search by multiple categories using category slugs; each slug must be separated by comma ,.
merchantId Search data by merchant. The merchant ID must be a valid integer.
rating Search data by user rating, data will be searched by ratings greater than the value specified. Take note that not all deals have been rated. Must be an integer between 0 and 5. By default: 0.
expiresAfter Search data by expire date, data will be searched by expiration dates greater or equal to the value specified. Valid date format YYYY-MM-DD . By default: current date.
order Order the results. Order by multiple criteria, each criteria must be separated by comma ,. You can order by any of the columns from the results. Add _desc as postfix if you want a descendant order. By default: expiresAt.

Results

Column Description
id Record (deal) id.
title Deal title.
shortTitle Deal short title.
url Deal URL.
price Regular price in $US (U.S. dollars).
promotionalPrice Promotional (discounted) price in $US (U.S. dollars).
discount Discount in percentage.
savings Savings in $US (U.S. dollars).
imageURL Image related to the deal.
description Deal description.
sold Number of deals sold.
clicked Number of clicks or views.
rating Average user rating, goes from 0 to 5 (where 0 means that the deal has never been rated).
merchant Merchant information.
Column Description
id Record (merchant) id.
name Merchant name.
address Merchant address.
locality Merchant locality.
region Merchant region.
postalCode Merchant postal code.
country Merchant country.
countryCode Merchant country code.
latitude Merchant latitude.
longitude Merchant longitude.
categories List of categories related to the deal.
Column Description
id Record (category) id.
name Category name.
slug Category slug.
createdAt Date the record was created.
updatedAt Date the record was last updated.
expiresAt Date the deal expires.

Example

Request
http://api.lucyvegas.com/client/v1/deal?access_token={...}&limit=1&location=Las+Vegas+Nevada&order=price_desc
Response (JSON)
{
    "error": false,
    "results": [],
    "query": {
        "limit": 1,
        "skip": 0,
        "location": {
            "latitude": 36.1699412,
            "longitude": -115.1398296
        }
    },
    "0": 200
}

Request a single deal

Use this to request a single deal. Call this request using the GET http method, the results will be in JSON format.

Request URL

http://api.lucyvegas.com/client/v1/deal/{id}

Filter parameters

Use these options as query string variables to filter the request's results:

Variable Description
{id} Deal ID.

Results

A single record is returned with the same columns as the ones explained when you request for multiple deals.

Example

Request
http://api.lucyvegas.com/client/v1/deal/399?access_token={...}
Response (JSON)
{
    "error": false,
    "deal": {
        "id": 399,
        "title": "Exclusive Summer Pricing on BMW Motorcycle Rentals! ",
        "shortTitle": "Las Vegas BMW Motorcycle Rentals 15% off!",
        "url": "http:\/\/www.lucyvegas.com\/deal\/399\/exclusive-summer-pricing-on-bmw-motorcycle-rentals-\/",
        "price": 0,
        "promotionalPrice": 0,
        "discount": 0,
        "savings": 0,
        "imageUrl": "http:\/\/www.lucyvegas.com\/wp-content\/uploads\/2016\/07\/Untitled-1.jpg",
        "description": "

SUMMER IS UPON US, TIME TO GET OUT AND RIDE!<\/strong><\/u><\/u><\/p>\r\n

 <\/p>\r\n

Now through August 31st 2016 save 15% on any three day or more BMW Motorrad rental<\/strong>, visit Valley or Fire, Death Valley or even take a cruise to Cali and run the PCH! Ask our friendly rental staff on what rides there are to be had, what amazing sights there are to see and “Explore The Other Side of Vegas!  $500 off on top of current BMW<\/span> Motorrad sales incentives on all 2016 new models and select remaining 2015 new models if you currently own a non-BMW<\/span> motorcycle no trade necessary! <\/strong><\/p>\r\n

 <\/p>\r\n

It is already known that BMW is one of the top motorcycle manufacturers and are considered among the most capable machines from the streets.  They have been able to keep their status thanks to numerous technical innovations and the latest technologies and performances!<\/span><\/p>\r\n

Come see our newly remodeled showroom and see this amazing bike plus new merchandise!<\/font><\/p>\r\n

PLEASE CLICK 'CLAIM NOW' ABOVE AND THEN PRINT OR PRESENT THIS PAGE ON YOUR MOBILE DEVICE TO RECEIVE YOUR DISCOUNT AT TIME OF PURCHASE!<\/span><\/span><\/h3>\r\n
Please limit one purchase item per customer.<\/div>", "sold": 0, "clicked": 3888, "rating": 0, "merchant": { "id": 496, "name": "BMW Motorcycles of Las Vegas", "address": "6675 South Tenaya Way \r\nLas Vegas, NV 89113, USA", "locality": "Las Vegas", "region": "NV", "postalCode": 89113, "country": "United States", "countryCode": "US", "latitude": 36.0670484, "longitude": -115.2519877 }, "categories": [ { "id": 78, "name": "Activities & Events", "slug": "activities-and-events", "created_at": "2014-03-25 03:03:15", "updated_at": "2014-03-25 03:03:15", "active": 1, "excluded": 0 }, { "id": 79, "name": "Automotive", "slug": "automotive", "created_at": "2014-03-25 03:03:40", "updated_at": "2014-03-25 03:03:40", "active": 1, "excluded": 0 } ], "createdAt": "2016-07-22", "updatedAt": "2017-11-21", "expiresAt": "2016-08-31" }, "0": 200 }