Sidebuy API V1

We are here to help.
if you need assistance with integrating our API, chat with one of us and we will get you running in no time.
Online API help chat
Step 1
Get your API Key.
There is no daily limit once you obtain an API Key
Generate your API Key
Step 2
Sample Code

We try to make it easy for you to integrate Sidebuy API to your platform. You might as well just copy and paste the code from these sample codes to your project.

github_logo
Visit our Github page for all source codes.
Step 3
API Documentation

API Endpoint

http://v1.sidebuy.com/api/get/{api_key}/?{parameters}

Example: http://v1.sidebuy.com/api/get/abc62ee1fd09c296fb9f45702063a374/?city=vancouver&search=spa<s>pizza&format=xml

*By default sidebuy API uses RESTful GET requests. However POST requests are also supported and work in the same way.

*The API Key provided in the samples only works 500 times for testing purposes only. You need to get your own API key for unlimited access to this API.

Request parameters

These parameters can be passed along with the API endpoint. for a basic request either city or loc + range + mkm must be passed.
param name
requirement
value
value example
format
optional
json, xml (type: string) (default: json)
xml
city
optional
vancouver
loc
optional
(Latitude, Longitude) (type: string)
(49.3493514, -123.1889754)
range
must be provided if loc is set
range (type: int)
radius to retrieve deals
km
mkm
must be provided if loc is set
km or mile (type: string)
50
search
optional
keyword search (type: string)
separate by <s> for multiple keywords.
spa<s>laser hair removal<s>pizza
category
optional
category (type: int)
0 - other
1 - activities
2 - events
3 - food
4 - health & beauty
5 - pets
6 - services
7 - shopping
8 - sports
9 - travel

separate by <s> for multiple categories
1<s>5<s>9
online
loc or city must be specified. Online deals are available in the whole country where the city is located. e.g. Displaying online deals where city is Sydney will return all deals that are available in Australia.
true/false
true
travel
loc & city must not be specified
true/false
false
provider
(optional)
provider name(type: string)
View a list of providers
groupon
fields
optional
fields to return
available fields: title, description, expiryepoch, link, image, price, original_price, discount, saving, city, fineprint, highlights, merchant
separate by <s> for multiple fields
title<s>price<s>merchant
limit
optional
start_from_number-to_number
(type: string) (default: 0-100)
0-20
sort
optional
field name | -1/1
(type: string) (default: expiryepoch)
field name separated by | -1 = DESC, 1 = ASC
expiryepoch|-1
epoch_to_time
optional
If set to true, the expiryepoch is converted to a human readable text
e.g. 4 days 3 hours 20 minutes
true
callback
optional
Call back function for json
Note: json must be used as the format.
show_deals

Response parameters

Sidebuy API response is in JSON format. Therefore the response is a valid JSON document and some characters need to be translated back to HTML. For more information view examples.

field name
description
example
hash
a unique identifier for this deal
e12d5602f665ae3e34a960094878cd8c
title
deal title
$20 worth food and beverages at the Italian Pizza restaurant.
description
deal description
Eat at the best pizzeria in the heart of Downtown Vancouver. We provide local, organic ingredients for all our pizzas.
Menu
  • Hawaiian
  • Pepperoni
  • Mushroom Lovers
  • Italian Sausage
addedepoch
the time this deal has been added to Sidebuy in epoch format.
1329674873
expiryepoch
deal expiry in epoch format.
1329674873
link
deal url
http://sidebuy.com/deals/deal/20-dollar-worht-food-and-beverages-at-the-best-italian-pizzeria-4f2b3745d692285a3a000001
image
deal image
http://sidebuy.s3.amazonaws.com/13298004277355.jpg
price
deal price
$10.00
original_price
deal value
$20.00
discount
deal discount
$10.00
saving
deal savings
%50
currency
deal currency
Deal currency if other than $.
A$
market
deal market
If a deal is not in US or Canada, deal market is provided.
au
city
deal city
Vancouver
fineprint
deal fineprints
Valid until July, 30th, 2013. Must not be used in conjunction with other deals and offers. Reservation required.
highlights
deal highlights
Delectable fire and coal pizza. Plus a beer & wine selection. Delicious fire roasted wings.
provider
deal provider
groupon.
merchant
merchant information array
"merchant":{
"name":"The Best Pizerria",
"address":"23220 West Hastings",
"city":"Vancouver",
"zip":"V6A 3ST",
"state":"BC",
"country":"Canada",
"tel":"604 001 9339",
"website":"www.thebestpizzeria.ca"
}
Step 4
Examples

*The API Key provided in the samples only works 500 times for testing purposes only. You need to get your own API key for unlimited access to this API.


Basic usage: Retrieve all deals in New York.

http://v1.sidebuy.com/api/get/abc62ee1fd09c296fb9f45702063a374/?city=new-york

format: Retrieve all deals in New York in XML (for JSON, change format to json)

http://v1.sidebuy.com/api/get/abc62ee1fd09c296fb9f45702063a374/?city=new-york&format=xml

Search: Retrieve all deals in New York with keyword "pizza" and "spa".

http://v1.sidebuy.com/api/get/abc62ee1fd09c296fb9f45702063a374/?city=new-york&search=pizza<s>spa

Retrieve all deals within 50 miles of New York using Coordinates (40.7143528,-74.0059731). For km, change miles to km.

http://v1.sidebuy.com/api/get/abc62ee1fd09c296fb9f45702063a374/?loc=(40.7143528,-74.0059731)&range=50&mkm=mile

Retrieve all deals within 50 miles of New York using Coordinates and filter by category (food, shopping)

http://v1.sidebuy.com/api/get/abc62ee1fd09c296fb9f45702063a374/?loc=(40.7143528,-74.0059731)&range=50&mkm=mile&category=3<s>7

Retrieve all deals in New York, sort by expiry.

http://v1.sidebuy.com/api/get/abc62ee1fd09c296fb9f45702063a374/?city=new-york&sort=expiryepoch|-1

Retrieve all deals in New York, only return first 5 deals (useful for record set paging. to view the next batch of 5 deals change to 5-10 and so on)

http://v1.sidebuy.com/api/get/abc62ee1fd09c296fb9f45702063a374/?city=new-york&limit=0-5

Retrieve all deals in New York, only return second 5 deals (see previous example)

http://v1.sidebuy.com/api/get/abc62ee1fd09c296fb9f45702063a374/?city=new-york&limit=5-10

Retrieve all travel deals.

http://v1.sidebuy.com/api/get/abc62ee1fd09c296fb9f45702063a374/?travel=true

Retrieve all online deals.

http://v1.sidebuy.com/api/get/abc62ee1fd09c296fb9f45702063a374/?online=true&city=new-york

Retrieve deal titles and prices from New York.

http://v1.sidebuy.com/api/get/abc62ee1fd09c296fb9f45702063a374/?city=new-york&fields=title<s>price

Retrieve all deals within 100 km of New York that are provided by Groupon display in XML format.

http://v1.sidebuy.com/api/get/abc62ee1fd09c296fb9f45702063a374/?loc=(40.7143528,-74.0059731)&range=100&mkm=km&provider=grouponus&format=xml

view a live response example in JSONview a live response example in XML



Sample JSON response

[     {         "addedepoch": "1329863852",
        "category": "0",
        "city": "new-york",
        "description": "a long description",
        "hash": "127962256f2e5ee6e3edc99739ac8cc4",
        "highlights": "",
        "id": "431343",
        "image": "http://sidebuy.s3.amazonaws.com/13298638518598.jpg",
        "link": "http://sidebuy.com/deals/affiliate/abc62ee1fd09c296fb9f45702063a374/4f1e0b1fd692283304000075",
        "loc": {
            "latitude": 40.7737536,
            "longitude": -73.9660434
        },
        "merchant": {
            "name": "Underdog Fitness",
            "address": "East 74th St. and 5th Ave. New York,  NY 10021",
            "city": "",
            "zip": "",
            "state": "",
            "country": "",
            "tel": "",
            "website": "http://www.underdogfitness.com"
        },
        "online": "false",
        "original_price": "1306.00",
        "price": 499,
        "provider": "pinchit",
        "saving": "807.00",
        "title": "63% Off personalized workout program",
        "travel": "false"
    },
    {
        "addedepoch": "1329863853",
        "category": "2",
        "city": "new-york",
        "description": "a long description",
        "hash": "193c0a69a0bde7e69ac5aad4c9b0cdad",
        "highlights": "",
        "id": "431344",
        "image": "http://sidebuy.s3.amazonaws.com/13298638533187.jpg",
        "link": "http://sidebuy.com/deals/affiliate/abc62ee1fd09c296fb9f45702063a374/4f1e0b1fd69228cd0f000146",
        "loc": {
            "latitude": 40.722976,
            "longitude": -73.9999595
        },
        "merchant": {
            "name": "Winter Beertopia",
            "address": "82 Mercer Street New York,  NY 10012",
            "city": "",
            "zip": "",
            "state": "",
            "country": "",
            "tel": "",
            "website": "http://www.iadventure.com"
        },
        "online": "false",
        "original_price": "30.00",
        "price": 15,
        "provider": "pinchit",
        "saving": "15.00",
        "title": "50% Off VIP tickets",
        "travel": "false"