SinglePlatform Actions API
The SinglePlatform Actions API enables the retrieval and monetization of Local Action URLs for the hundreds of thousands of merchants represented by SinglePlatform’s Local Action Network. All of the Action URLs retrieved through this API are appended with referrer codes, based on API credentials.
Partner Agreement Considerations
Our partners are required to comply with SinglePlatform's partner agreement.
Authentication
To interact with the Actions API, you must generate a HMAC-SHA1 signature for each HTTP request made to the API. By this point, you should have received a valid and unique {Client ID, Signing Key} pair from SinglePlatform.
For the following example, suppose your Client ID is cn3l4kmhdcxejosjf6chfjoiq
and your signing key is QRFYeaX2m4gGlsmG-B5sqhS4DQS3wwpC-QupqYaxBoU
.
-
Construct the signature base string
- Start with your path for the resource, e.g.
/locations/test-pizzeria/actions/
, this includes a starting and trailing slash (/
). - Append all URL parameters (e.g.
type=foodordering
). Parameters should be appended as the would normally in a URL, namely the first parameter is appending with a leading?
and subsequent ones with a&
. - Append your Client ID (e.g.
&client=cn3l4kmhdcxejosjf6chfjoiq
).
At this point the example base string looks like this:
/locations/test-pizzeria/actions/?type=foodordering&client=cn3l4kmhdcxejosjf6chfjoiq
. - Start with your path for the resource, e.g.
-
Calculate the signature
- Pass the signature base string and your Signing Key to the HMAC-SHA1 hashing algorithm to generate the key.
- Base64-encode the generated key.
At this point they key for the example URL should be
cuP+jQO57X7E1rCT+vEoKxN2LNg=
. - Percent-encode the string to make it URL safe.
For the example URL, the generated signature should be
cuP%2BjQO57X7E1rCT%2BvEoKxN2LNg%3D
. -
Append the signature to the URL For the example, the final URL would look like this:
http://singleapi.com/locations/test-pizzeria/actions/?type=foodordering&client=cn3l4kmhdcxejosjf6chfjoiq&signature=cuP%2BjQO57X7E1rCT%2BvEoKxN2LNg%3D
Action Resource
Actions returned by the different endpoints have the following fields:
Field | Type | Nullable | Description | Example |
---|---|---|---|---|
id |
Integer | false |
The unique action ID. | 943 |
location_id |
String | false |
The location ID of the action. | test-pizzeria |
type |
String | false |
The action type. | foodordering |
url |
String | false |
The action URL. | http://redirect.singleapi.com/?trackingId=sp-l1118629-t5-p0 |
js_source |
String | true |
If embedding a widget, the URL to the Javascript source. | null |
suggested_cta |
String | true |
The suggested call to action. | Order Online |
suggested_cta_asset |
String | true |
The asset corresponding to the suggested call to action. | http://assets.singleapi.com/Asset_21.svg |
Action Types
Valid type
s for actions are listed below:
Type | Numeric ID |
---|---|
foodordering |
1 |
deal |
2 |
coupon |
3 |
giftcard |
4 |
discountgiftcard |
5 |
discountcertificate |
6 |
foodreservation |
7 |
booking |
8 |
joinmailinglist |
9 |
other |
10 |
In general, filtering is supported using both action type name and the numeric ID.
Action Attributes
Certain action types (e.g. deal
, coupon
, etc) have an additional attributes
field that is itself an object and provides additional context.
The attributes
should be assumed to have variable information but in general contain the following fields:
Field | Type | Nullable | Description | Example |
---|---|---|---|---|
category |
String | true |
A general description of the action's category. | Spa |
description |
String | true |
A more detailed description of the action. | Find your perfect wellness experience. |
discount |
Float | true |
A discount amount, in dollars. | 40 |
discount_percentage |
Float | true |
If specified, ranges from 0 to 1. | .2 |
expiration |
String | true |
If applicable, the expiration of the action (e.g. for a coupon). | 2014-12-31T07:00:00Z |
image_url |
String | true |
If applicable, an image URL representing the action. | http://goo.gl/sRy58k |
title |
String | true |
A short description of the action. | 10% off Spa & Wellness Gift Cards. |
Location Resource
Along with Actions, Location resources are embedded in responses for additional context.
Location resources have the following fields:
Field | Type | Nullable | Description | Example |
---|---|---|---|---|
id |
String | false |
The unique SinglePlatform location ID. | test-pizzeria |
created |
String | false |
- | 2011-12-01T00:00:00Z |
updated |
String | false |
- | 2014-07-18T16:53:33Z |
owner_verified |
Boolean | false |
- | True |
name |
String | false |
The location name. | Test Pizzeria |
phone_number |
String | true |
The 10-digit dash-separated location phone number. | 212-867-5309 |
address1 |
String | false |
- | 17 Battery Pl |
address2 |
String | true |
- | null |
city |
String | false |
- | New York |
state |
String | false |
The 2-character state. | NY |
postal_code |
String | false |
- | 10004 |
country |
String | false |
- | US |
latitude |
Float | true |
- | 40.7057643 |
longitude |
Float | true |
- | -74.0170059 |
business_type |
String | true |
- | Restaurant |
cuisine_types |
String Array | true |
A list of cuisine types. | ["Pizza", "American - Contemporary"] |
Errors
When any error occurs, an error resource is returned. Errors have the following fields.
Field | Type | Nullable | Description |
---|---|---|---|
error |
String | false |
A short name describing the error. |
message |
String | false |
A short human-reable description of the error. |
status_code |
Integer | false |
The HTTP status code of the error. |
Below are a few examples of common errors :
{
"error":"LIMIT_TOO_LARGE",
"message":"The value supplied for limit (201) was too large. The maximum is 100.",
"status_code":400
}
{
"error":"LOCATION_DOES_NOT_EXIST",
"message":"Location does not exist for 'does-not-exist'.",
"status_code":404
}
Group Locations
Endpoints under locations
allow querying for actions using SinglePlatform Location IDs (e.g. test-pizzeria
).
List All Location IDs [/locations/]
Get all location IDs for locations that have actions.
Please note that at the moment this response is not paginated and is likely to be very large, and should only
be used on initial integration. For updates, use the updated
endpoint below.
GET [GET]
- Response 200 (application/json)
[ "location-1", "location-2", ... "test-pizzeria", ... ]
List Location Updates [/locations/updated/{?since,limit,location_id}]
Get a list of location updates, including location IDs and update metadata based on a starting time. At the moment no metadata is included but in the future more information will be added (e.g. the type of update).
API clients can use the returned location IDs in conjuction with the location-specific endpoint below to get a full update.
To be specific, after retrieving a list of location updates, which include location_id
s, the API client should make a separate request
to the location-specific endpoint (/locations/{location_id}/actions/
) to retrieve the full updates for each location that was updated.
Pagination for this endpoint is implemented with the Link Header. Essentially, when more results are available, the API will return a header such as:
Link: </locations/updated/?location_id=twins-gyros&since=2014-10-06T15%3A31%3A16.992213Z>; rel="next",
The Link Header includes the "next" page of results as a relative path. The API client must simply follow that path to get the next page of results. When a next page does not exist, the link header will not be present.
The results returned by this endpoint are ordered by update time. Ties in update times are broken using the location_id
.
All date times, including Link Header and URL parameter date times are in RFC3339 format.
- Parameters
- since (required, string,
2015-01-03T15:04:05-05:00
) ... The RFC3339 formatted time. - limit =
1000
(optional, integer,2000
) The limit on the number of location updates to return. The maximum is 10,000. - location_id =
` (optional, string,
twins-gyros`) The location ID to use for breaking ties of update time. In practice, API clients should not need to specify this manually, since it is automatically set by the Link Header.
- since (required, string,
GET [GET]
-
Request with since="2014-10-06T10:07:42-04:00"
- Headers
Accept: application/json
- Headers
-
Response 200 (application/json)
-
Headers
Link: </locations/updated/?location_id=twins-gyros&since=2014-10-06T15%3A31%3A16.992213Z>; rel="next",
-
Body
[ { location_id: "10th--willow" }, { location_id: "mi-finca" }, { location_id: "nikos-gyros-6" }, { location_id: "creole-wings-fish-stacks-soul" }, { location_id: "espositos-ristorante" }, { location_id: "espositos-pizza-7" }, { location_id: "espositos-pizza-5" }, { location_id: "caffe-italia-21" } ]
-
Retrieve Actions for a Location [/locations/{location_id}/actions/{?top,nearby,type}]
Retrieve actions for a particular location using the location's SinglePlatform ID.
-
Parameters
- location_id (required, string,
test-pizzeria
) ... SinglePlatform location ID of the location for which you want actions. -
type (optional, string,
foodordering
) The action types to be returned. When this parameter is specified only actions of this type will be returned for the location. If no action of the specified type exist,actions
will be an empty array. This parameter can also be the action type numeric id (e.g.foodordering
and1
are valid). When this parameter is an invalid type, it is ignored and all actions are returned for the location.- Values
foodordering
deal
coupon
giftcard
discountgiftcard
discountcertificate
foodreservation
booking
joinmailinglist
other
- Values
-
top =
false
(optional, boolean,true
) Whether only the top action for the location should be returned. When this parameter istrue
, theactions
is no longer an array (it becomes an object) and is calledaction
. - nearby =
false
(optional, boolean,true
) ... Whether nearby actions should be returned if no actions exist for the specified location.
- location_id (required, string,
GET [GET]
-
Request with location_id="test-pizzeria"
- Headers
Accept: application/json
- Headers
-
Response 200 (application/json)
- Body
{ actions: [ { id: 92901, js_source: null, location_id: "test-pizzeria", suggested_cta: "Order Online", suggested_cta_asset: "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", type: "foodordering", url: "http://redirect.singleapi.com/?trackingId=sp-l49679-t1-p47" } ], location: { id: "test-pizzeria", created: "2011-12-01T00:00:00Z", updated: "2014-07-18T16:53:33Z", owner_verified: true, name: "Test Pizzeria", phone_number: "212-867-5309", address1: "17 Battery Pl", address2: null, city: "New York", state: "NY", postal_code: "10004", country: "US", latitude: 40.7057643, longitude: -74.0170059, business_type: "Restaurant", cuisine_types: [ "Pizza", "American - Contemporary" ] } }
- Body
-
Request with location_id="test-pizzeria" & top="true" (application/json)
-
Response 200 (application/json)
- Body
{ action: { id: 92901, js_source: null, location_id: "test-pizzeria", suggested_cta: "Order Online", suggested_cta_asset: "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", type: "foodordering", url: "http://redirect.singleapi.com/?trackingId=sp-l49679-t1-p47" }, location: { id: "test-pizzeria", created: "2011-12-01T00:00:00Z", updated: "2014-07-18T16:53:33Z", owner_verified: true, name: "Test Pizzeria", phone_number: "212-867-5309", address1: "17 Battery Pl", address2: null, city: "New York", state: "NY", postal_code: "10004", country: "US", latitude: 40.7057643, longitude: -74.0170059, business_type: "Restaurant", cuisine_types: [ "Pizza", "American - Contemporary" ] } }
- Body
-
Request for a location with no actions (application/json)
-
Response 200 (application/json)
- Body
{ actions: [], location: { id: "test-pizzeria", created: "2011-12-01T00:00:00Z", updated: "2014-07-18T16:53:33Z", owner_verified: true, name: "Test Pizzeria", phone_number: "212-867-5309", address1: "17 Battery Pl", address2: null, city: "New York", state: "NY", postal_code: "10004", country: "US", latitude: 40.7057643, longitude: -74.0170059, business_type: "Restaurant", cuisine_types: [ "Pizza", "American - Contemporary" ] } }
- Body
Retrieve Actions Near a Location [/locations/{location_id}/actions/nearby{?type,radius,limit,self,nearby_only,owner_verified,business_type,cuisine}]
Retrieve actions near a particular location using the location's SinglePlatform ID.
For most situations, the default parameter values are sufficient because the search for nearby actions is automatically expanded to the maximum radius when no actions are found using the supplied specified parameters.
Furthermore, using self=3
should work well enough for most queries because it will automatically expose a location's top 3 actions, if they exist or nearby actions if the location
does not have actions. This allows the client to avoid making one request to determine whether a location has actions and a subsequent request to retrieve nearby actions.
Put simply, calling this endpoint with ?self=3
may be the only call required to retrieve actions based on a SinglePlatform location ID.
Please Note: If the location is owner verified, the nearby response will only include actions belonging to that location. If no actions belong to that location, then the response will be an empty array.
- Parameters
- location_id (required, string,
test-pizzeria
) ... SinglePlatform location ID of the location for which you want actions. -
type (optional, string,
foodordering
) The action types to be returned. When this parameter is specified only actions of this type will be returned for the location. If no action of the specified type exist,actions
will be an empty array. This parameter can also be the action type numeric id (e.g.foodordering
and1
are valid). When this parameter is an invalid type, it is ignored and all actions are returned for the location.-
Values
foodordering
deal
coupon
giftcard
discountgiftcard
discountcertificate
foodreservation
booking
joinmailinglist
other
- radius =
1609
(optional, integer,1000
) ... The radius around the location to use for searching, in meters. The maximum value is16093
(10 miles). - limit =
10
(optional, integer,20
) ... The maximum number of actions to return. The maximum value is100
. - self (optional, integer,
3
) If specifiedself
becomes a limit on the number of same-location actions to return. Whenself
is specified and the location has actions, only the location's actions are returned as part of the response (and the value ofself
is a limit). Whenself
is specified and the location has no actions, the parameter value is ignored and a normal nearby query takes place. - nearby_only (optional, boolean,
false
) Whennearby_only
is true, actions belonging to thelocation_id
are automatically filtered out. Essentially,nearby_only
functions like the opposite ofself
, in that it excludes same-location actions from the response. - owner_verified (optional, boolean,
true
) Whenowner_verified
is specified, actions are filtered based on their location's owner_verified status. Note that this filtering occurs after the geolocation filtering parameters and may return an empty array where actions otherwise exist. - business_type (optional, string,
Restaurant
)business_type
is a comma-separated list of (url-encoded) location business types of interest which filter the actions returned. A fragment of thebusiness_type
may be specified (e.g. instead ofLegal & Financial Services
,legal
may be specified). This filtering occurs after the geolocation filtering parameters and may return an empty array where actions otherwise exist.
-
Values
Arts & Entertainment
Bakery
Bars & Clubs
Business & Professional Services
Coffee Shop
Community & Government
Education
Food & Beverage Retail
Gas Station
Legal & Financial Services
Medical Services
Non Food & Beverage Retail
Pet Services
Real Estate
Residential Services
Restaurant
Spas & Salons
Sports & Recreation
Travel, Tourism & Lodging
Non-Profit
- cuisine (optional, string,
pizza
)cuisine
is a comma-separated list of (url-encoded) location cuisine types to be used for filtering. This filtering occurs after the geolocation filtering parameters and may return an empty array where actions otherwise exist.
-
- location_id (required, string,
GET [GET]
-
Request with location_id="cafe-bravo-8"
- Headers
Accept: application/json
- Headers
-
Response 200 (application/json)
- Body
[ { "action": { "id": 7493, "js_source": null, "location_id": "cafe-bravo-8", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l654920-t1-p0" }, "location": { "id": "cafe-bravo-8", "created": "2011-12-01T00:00:00Z", "updated": "2014-05-08T15:31:09Z", "owner_verified": false, "name": "Cafe Bravo", "phone_number": "212-269-8900", "address1": "52 Broadway", "address2": null, "city": "New York", "state": "NY", "postal_code": "10004", "country": "US", "latitude": 40.70648, "longitude": -74.01229, "business_type": "Restaurant", "cuisine_types": null } }, { "action": { "attributes": { "category": null, "description": null, "discount": null, "discount_percentage": null, "expiration": null, "image_url": null, "title": null }, "id": 68641, "js_source": null, "location_id": "crossfit-wall-street", "suggested_cta": "Buy Gift Card", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_26.svg", "type": "giftcard", "url": "http://redirect.singleapi.com/?trackingId=sp-l1128414-t4-p0" }, "location": { "id": "crossfit-wall-street", "created": "2014-06-23T19:26:37Z", "updated": "2014-06-30T16:29:40Z", "owner_verified": false, "name": "CrossFit Wall Street", "phone_number": "646-490-4244", "address1": "60 New Street", "address2": null, "city": "New York City", "state": "NY", "postal_code": "", "country": "US", "latitude": 40.70605, "longitude": -74.01201, "business_type": "Spas \u0026 Salons", "cuisine_types": null } }, { "action": { "attributes": { "category": null, "description": null, "discount": null, "discount_percentage": null, "expiration": null, "image_url": null, "title": null }, "id": 72800, "js_source": null, "location_id": "jena-wellness", "suggested_cta": "Buy Gift Card", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_26.svg", "type": "giftcard", "url": "http://redirect.singleapi.com/?trackingId=sp-l1121308-t4-p0" }, "location": { "id": "jena-wellness", "created": "2014-06-23T18:27:44Z", "updated": "2014-07-01T07:24:27Z", "owner_verified": false, "name": "Jena Wellness", "phone_number": "212-260-6064", "address1": "30 Broad Street", "address2": null, "city": "New York City", "state": "NY", "postal_code": "", "country": "US", "latitude": 40.70626, "longitude": -74.01165, "business_type": "Spas \u0026 Salons", "cuisine_types": null } }, { "action": { "id": 2919, "js_source": null, "location_id": "sale--pepe", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l712458-t1-p0" }, "location": { "id": "sale--pepe", "created": "2011-12-01T00:00:00Z", "updated": "2014-05-29T12:31:03Z", "owner_verified": true, "name": "Sale \u0026 Pepe", "phone_number": "212-968-7700", "address1": "1 Exchange Plz", "address2": null, "city": "New York", "state": "NY", "postal_code": "10006", "country": "US", "latitude": 40.70685, "longitude": -74.01305, "business_type": "Restaurant", "cuisine_types": [ "American - Traditional", "Bagels \u0026 Spreads", "BBQ", "Burgers", "Comfort Foods", "Dessert", "Diner", "International", "Pasta", "Pizza", "Sandwiches", "Seafood", "Soups \u0026 Salads", "Vegetarian" ] } }, { "action": { "id": 9296, "js_source": null, "location_id": "china-chalet-2", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l558410-t1-p0" }, "location": { "id": "china-chalet-2", "created": "2011-12-01T00:00:00Z", "updated": "2014-05-08T15:32:33Z", "owner_verified": false, "name": "China Chalet", "phone_number": "212-943-4380", "address1": "47 Broadway", "address2": null, "city": "New York", "state": "NY", "postal_code": "10006", "country": "US", "latitude": 40.70666, "longitude": -74.01319, "business_type": "Restaurant", "cuisine_types": [ "Chinese" ] } }, { "action": { "id": 61412, "js_source": null, "location_id": "stir-cafe-on-broadway", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l31022-t1-p0" }, "location": { "id": "stir-cafe-on-broadway", "created": "2011-12-01T00:00:00Z", "updated": "2012-11-16T15:55:18Z", "owner_verified": true, "name": "Stir Cafe On Broadway", "phone_number": "212-425-5123", "address1": "32 Broadway", "address2": null, "city": "New York", "state": "NY", "postal_code": "10004", "country": "US", "latitude": 40.7058, "longitude": -74.01273, "business_type": "Restaurant", "cuisine_types": null } }, { "action": { "attributes": { "category": null, "description": null, "discount": null, "discount_percentage": null, "expiration": null, "image_url": null, "title": null }, "id": 63156, "js_source": null, "location_id": "reserve-cut-at-the-setai", "suggested_cta": "Buy Gift Card", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_26.svg", "type": "giftcard", "url": "http://redirect.singleapi.com/?trackingId=sp-l1109251-t4-p0" }, "location": { "id": "reserve-cut-at-the-setai", "created": "2014-04-16T13:18:42Z", "updated": "2014-06-16T01:52:02Z", "owner_verified": false, "name": "Reserve Cut at The Setai", "phone_number": "212-747-0300", "address1": "40 Broad St", "address2": null, "city": "New York", "state": "NY", "postal_code": "10004", "country": "US", "latitude": 40.70591, "longitude": -74.01147, "business_type": "Restaurant", "cuisine_types": null } }, { "action": { "id": 3830, "js_source": null, "location_id": "americas-finest-deli", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l1094652-t1-p0" }, "location": { "id": "americas-finest-deli", "created": "2013-12-02T11:25:47Z", "updated": "2014-05-08T15:28:15Z", "owner_verified": true, "name": "America's Finest Deli", "phone_number": "212-509-0930", "address1": "46 Trinity Place", "address2": null, "city": "New York", "state": "NY", "postal_code": "10006", "country": "US", "latitude": 40.706399, "longitude": -74.014071, "business_type": "Restaurant", "cuisine_types": [ "Deli" ] } }, { "action": { "id": 38204, "js_source": null, "location_id": "tajin-restaurant", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l835018-t1-p0" }, "location": { "id": "tajin-restaurant", "created": "2011-12-01T00:00:00Z", "updated": "2014-06-30T16:22:29Z", "owner_verified": false, "name": "Tajin Restaurant", "phone_number": "212-509-5017", "address1": "85 Greenwich St", "address2": null, "city": "New York", "state": "NY", "postal_code": "10006", "country": "US", "latitude": 40.70776, "longitude": -74.01358, "business_type": "Restaurant", "cuisine_types": null } }, { "action": { "id": 17913, "js_source": null, "location_id": "georges-24", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l588058-t1-p0" }, "location": { "id": "georges-24", "created": "2011-12-01T00:00:00Z", "updated": "2014-06-10T00:31:35Z", "owner_verified": true, "name": "George's", "phone_number": "212-269-8026", "address1": "89 Greenwich St", "address2": null, "city": "New York", "state": "NY", "postal_code": "10006", "country": "US", "latitude": 40.70776, "longitude": -74.01358, "business_type": "Restaurant", "cuisine_types": null } } ]
- Body
-
Request with location_id="cafe-bravo-8" & self=1
- Headers
Accept: application/json
- Headers
-
Response 200 (application/json)
[ { "action": { "id": 7493, "js_source": null, "location_id": "cafe-bravo-8", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l654920-t1-p0" }, "location": { "id": "cafe-bravo-8", "created": "2011-12-01T00:00:00Z", "updated": "2014-05-08T15:31:09Z", "owner_verified": false, "name": "Cafe Bravo", "phone_number": "212-269-8900", "address1": "52 Broadway", "address2": null, "city": "New York", "state": "NY", "postal_code": "10004", "country": "US", "latitude": 40.70648, "longitude": -74.01229, "business_type": "Restaurant", "cuisine_types": null } } ]
-
Request for an owner-verified location with no actions
- Headers
Accept: application/json
- Headers
-
Response 200 (application/json)
[ ]
Group Actions
Retrieve Actions by latitude & longitude [/actions/nearby{?latitude,longitude,radius,limit,type,owner_verified,business_type,cuisine}]
Actions can be retrieved via this endpoint using geolocation parameters.
- Parameters
- latitude (required, float,
40.708815
) ... The latitude of the center. - longitude (required, float,
-74.0079341
) ... The longitude of the center. - radius =
1609
(optional, integer,1000
) ... The radius around the location to use for searching, in meters. The maximum value is16093
(10 miles). - limit =
10
(optional, integer,20
) ... The maximum number of actions to return. The maximum value is100
. -
type (optional, string,
foodordering
) The action types to be returned. When this parameter is specified only actions of this type will be returned for the location. If no action of the specified type exist,actions
will be an empty array. This parameter can also be the action type numeric id (e.g.foodordering
and1
are valid). When this parameter is an invalid type, it is ignored and all actions are returned for the location.-
Values
foodordering
deal
coupon
giftcard
discountgiftcard
discountcertificate
foodreservation
booking
joinmailinglist
other
- owner_verified (optional, boolean,
true
) Whenowner_verified
is specified, actions are filtered based on their location's owner_verified status. Note that this filtering occurs after the geolocation filtering parameters and may return an empty array where actions otherwise exist. - business_type (optional, string,
Restaurant
)business_type
is a comma-separated list of (url-encoded) location business types of interest which filter the actions returned. A fragment of thebusiness_type
may be specified (e.g. instead ofLegal & Financial Services
,legal
may be specified). This filtering occurs after the geolocation filtering parameters and may return an empty array where actions otherwise exist.
-
Values
Arts & Entertainment
Bakery
Bars & Clubs
Business & Professional Services
Coffee Shop
Community & Government
Education
Food & Beverage Retail
Gas Station
Legal & Financial Services
Medical Services
Non Food & Beverage Retail
Pet Services
Real Estate
Residential Services
Restaurant
Spas & Salons
Sports & Recreation
Travel, Tourism & Lodging
Non-Profit
- cuisine (optional, string,
pizza
)cuisine
is a comma-separated list of (url-encoded) location cuisine types to be used for filtering. This filtering occurs after the geolocation filtering parameters and may return an empty array where actions otherwise exist.
-
- latitude (required, float,
GET [GET]
-
Request with latitude="40.708815" and longitude="-74.0079341"
- Headers
Accept: application/json
- Headers
-
Response 200 (application/json)
[ { "action": { "id": 61587, "js_source": null, "location_id": "zeytuna", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l566-t1-p0" }, "location": { "id": "zeytuna", "created": "2011-12-01T00:00:00Z", "updated": "2014-05-08T15:58:24Z", "owner_verified": false, "name": "59 Zeytuna", "phone_number": "212-742-2436", "address1": "59 Maiden Ln", "address2": null, "city": "New York", "state": "NY", "postal_code": "10038", "country": "US", "latitude": 40.70822, "longitude": -74.00809, "business_type": "Restaurant", "cuisine_types": [ "Vegan", "Pizza" ] } }, { "action": { "id": 46153, "js_source": null, "location_id": "cafe-41", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l1105009-t1-p0" }, "location": { "id": "cafe-41", "created": "2014-04-16T12:44:38Z", "updated": "2014-05-17T09:43:38Z", "owner_verified": false, "name": "Cafe 41", "phone_number": "212-227-4375", "address1": "41 John St", "address2": null, "city": "New York", "state": "NY", "postal_code": "10038", "country": "US", "latitude": 40.70947, "longitude": -74.00793, "business_type": "Restaurant", "cuisine_types": null } }, { "action": { "id": 46289, "js_source": null, "location_id": "benton-cafe", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l1105150-t1-p0" }, "location": { "id": "benton-cafe", "created": "2014-04-16T12:45:42Z", "updated": "2014-05-17T09:35:00Z", "owner_verified": false, "name": "BentOn Cafe", "phone_number": "212-608-8850", "address1": "123 William St", "address2": null, "city": "New York", "state": "NY", "postal_code": "10038", "country": "US", "latitude": 40.70926, "longitude": -74.00722, "business_type": "Restaurant", "cuisine_types": null } }, { "action": { "id": 66069, "js_source": "https://singleplatform.eat24hours.com/", "location_id": "simit-and-smith---william-st", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l1115653-t1-p0" }, "location": { "id": "simit-and-smith---william-st", "created": "2014-06-23T17:47:50Z", "updated": "2014-06-30T16:23:46Z", "owner_verified": false, "name": "Simit and Smith - William St", "phone_number": "646-964-5629", "address1": "100 William St", "address2": null, "city": "New York", "state": "NY", "postal_code": "10038", "country": "US", "latitude": 40.70834, "longitude": -74.00717, "business_type": "Restaurant", "cuisine_types": null } }, { "action": { "id": 19641, "js_source": null, "location_id": "health-king", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l322045-t1-p0" }, "location": { "id": "health-king", "created": "2011-12-01T00:00:00Z", "updated": "2014-05-08T15:39:59Z", "owner_verified": true, "name": "Health King", "phone_number": "212-619-8030", "address1": "65 Nassau St", "address2": null, "city": "New York", "state": "NY", "postal_code": "10038", "country": "US", "latitude": 40.70948, "longitude": -74.00867, "business_type": "Restaurant", "cuisine_types": null } }, { "action": { "id": 38683, "js_source": null, "location_id": "taz-cafe", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l783342-t1-p0" }, "location": { "id": "taz-cafe", "created": "2011-12-01T00:00:00Z", "updated": "2014-06-30T16:19:59Z", "owner_verified": false, "name": "Taz Cafe", "phone_number": "212-742-8009", "address1": "84 William St Frnt", "address2": null, "city": "New York", "state": "NY", "postal_code": "10038", "country": "US", "latitude": 40.70795, "longitude": -74.00772, "business_type": "Restaurant", "cuisine_types": null } }, { "action": { "id": 9026, "js_source": null, "location_id": "chickpea-4", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l770187-t1-p0" }, "location": { "id": "chickpea-4", "created": "2011-12-01T00:00:00Z", "updated": "2014-05-08T15:32:21Z", "owner_verified": false, "name": "Chickpea", "phone_number": "212-566-5666", "address1": "110 William St", "address2": null, "city": "New York", "state": "NY", "postal_code": "10038", "country": "US", "latitude": 40.70878, "longitude": -74.00673, "business_type": "Restaurant", "cuisine_types": null } }, { "action": { "id": 13073, "js_source": null, "location_id": "diwan-khas", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l420093-t1-p0" }, "location": { "id": "diwan-khas", "created": "2011-12-01T00:00:00Z", "updated": "2014-05-08T15:34:45Z", "owner_verified": false, "name": "Diwan Khas", "phone_number": "212-571-7676", "address1": "53 Nassau St", "address2": null, "city": "New York", "state": "NY", "postal_code": "10038", "country": "US", "latitude": 40.70902, "longitude": -74.00912, "business_type": "Restaurant", "cuisine_types": null } }, { "action": { "id": 37748, "js_source": null, "location_id": "sushi-a-la-kawa-22", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l16875-t1-p0" }, "location": { "id": "sushi-a-la-kawa-22", "created": "2011-12-01T00:00:00Z", "updated": "2014-06-30T16:19:55Z", "owner_verified": false, "name": "Sushi A La Kawa 22", "phone_number": "212-766-0811", "address1": "22 Maiden Ln", "address2": null, "city": "New York", "state": "NY", "postal_code": "10038", "country": "US", "latitude": 40.7091, "longitude": -74.00912, "business_type": "Restaurant", "cuisine_types": null } }, { "action": { "id": 22758, "js_source": null, "location_id": "kortako", "suggested_cta": "Order Online", "suggested_cta_asset": "http://w.singlepage.com/static/images/singlepg/assets/mobile/Asset_21.svg", "type": "foodordering", "url": "http://redirect.singleapi.com/?trackingId=sp-l372824-t1-p0" }, "location": { "id": "kortako", "created": "2011-12-01T00:00:00Z", "updated": "2014-06-23T04:40:02Z", "owner_verified": false, "name": "Kortako", "phone_number": "212-964-4625", "address1": "80 Nassau St", "address2": null, "city": "New York", "state": "NY", "postal_code": "10038", "country": "US", "latitude": 40.70978, "longitude": -74.00785, "business_type": "Restaurant", "cuisine_types": null } } ]