Skip to main content
POST
/
api
/
grubhub
/
restaurants
/
search
/grubhub/restaurants/search
curl --request POST \
  --url https://api.anysite.io/api/grubhub/restaurants/search \
  --header 'Content-Type: application/json' \
  --header 'access-token: <api-key>' \
  --data '
{
  "latitude": 0,
  "longitude": 0,
  "count": 2,
  "timeout": 300,
  "keyword": "<string>",
  "order_method": "delivery",
  "sort": "recommended",
  "cuisines": [],
  "price_max": 2,
  "top_rated": false,
  "under_30_min": false,
  "offers": false,
  "free_delivery": false,
  "grubhub_plus": false,
  "open_now": false,
  "new_only": false,
  "national_brands": false,
  "alcohol": false,
  "order_tracking": false,
  "shared_cart": false
}
'
import requests

url = "https://api.anysite.io/api/grubhub/restaurants/search"

payload = {
"latitude": 0,
"longitude": 0,
"count": 2,
"timeout": 300,
"keyword": "<string>",
"order_method": "delivery",
"sort": "recommended",
"cuisines": [],
"price_max": 2,
"top_rated": False,
"under_30_min": False,
"offers": False,
"free_delivery": False,
"grubhub_plus": False,
"open_now": False,
"new_only": False,
"national_brands": False,
"alcohol": False,
"order_tracking": False,
"shared_cart": False
}
headers = {
"access-token": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
latitude: 0,
longitude: 0,
count: 2,
timeout: 300,
keyword: '<string>',
order_method: 'delivery',
sort: 'recommended',
cuisines: [],
price_max: 2,
top_rated: false,
under_30_min: false,
offers: false,
free_delivery: false,
grubhub_plus: false,
open_now: false,
new_only: false,
national_brands: false,
alcohol: false,
order_tracking: false,
shared_cart: false
})
};

fetch('https://api.anysite.io/api/grubhub/restaurants/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.anysite.io/api/grubhub/restaurants/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'latitude' => 0,
'longitude' => 0,
'count' => 2,
'timeout' => 300,
'keyword' => '<string>',
'order_method' => 'delivery',
'sort' => 'recommended',
'cuisines' => [

],
'price_max' => 2,
'top_rated' => false,
'under_30_min' => false,
'offers' => false,
'free_delivery' => false,
'grubhub_plus' => false,
'open_now' => false,
'new_only' => false,
'national_brands' => false,
'alcohol' => false,
'order_tracking' => false,
'shared_cart' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"access-token: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.anysite.io/api/grubhub/restaurants/search"

payload := strings.NewReader("{\n \"latitude\": 0,\n \"longitude\": 0,\n \"count\": 2,\n \"timeout\": 300,\n \"keyword\": \"<string>\",\n \"order_method\": \"delivery\",\n \"sort\": \"recommended\",\n \"cuisines\": [],\n \"price_max\": 2,\n \"top_rated\": false,\n \"under_30_min\": false,\n \"offers\": false,\n \"free_delivery\": false,\n \"grubhub_plus\": false,\n \"open_now\": false,\n \"new_only\": false,\n \"national_brands\": false,\n \"alcohol\": false,\n \"order_tracking\": false,\n \"shared_cart\": false\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.anysite.io/api/grubhub/restaurants/search")
.header("access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"latitude\": 0,\n \"longitude\": 0,\n \"count\": 2,\n \"timeout\": 300,\n \"keyword\": \"<string>\",\n \"order_method\": \"delivery\",\n \"sort\": \"recommended\",\n \"cuisines\": [],\n \"price_max\": 2,\n \"top_rated\": false,\n \"under_30_min\": false,\n \"offers\": false,\n \"free_delivery\": false,\n \"grubhub_plus\": false,\n \"open_now\": false,\n \"new_only\": false,\n \"national_brands\": false,\n \"alcohol\": false,\n \"order_tracking\": false,\n \"shared_cart\": false\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.anysite.io/api/grubhub/restaurants/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"latitude\": 0,\n \"longitude\": 0,\n \"count\": 2,\n \"timeout\": 300,\n \"keyword\": \"<string>\",\n \"order_method\": \"delivery\",\n \"sort\": \"recommended\",\n \"cuisines\": [],\n \"price_max\": 2,\n \"top_rated\": false,\n \"under_30_min\": false,\n \"offers\": false,\n \"free_delivery\": false,\n \"grubhub_plus\": false,\n \"open_now\": false,\n \"new_only\": false,\n \"national_brands\": false,\n \"alcohol\": false,\n \"order_tracking\": false,\n \"shared_cart\": false\n}"

response = http.request(request)
puts response.read_body
[
  {
    "id": "<string>",
    "@type": "GrubhubSearchRestaurant",
    "name": "<string>",
    "url": "<string>",
    "alias": "<string>",
    "brand_name": "<string>",
    "chain_name": "<string>",
    "image": "<string>",
    "cuisines": [],
    "rating": 123,
    "rating_count": 123,
    "price_rating": 123,
    "coupon_count": 0,
    "delivery_fee": 123,
    "delivery_minimum": 123,
    "delivery_time": 123,
    "delivery_time_min": 123,
    "delivery_time_max": 123,
    "distance": 123,
    "open": false,
    "delivery": false,
    "pickup": false,
    "is_new": false
  }
]
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

access-token
string
header
required

API token from the dashboard

Headers

access-token
string
required

Body

application/json
latitude
number
required
Required range: -90 <= x <= 90
longitude
number
required
Required range: -180 <= x <= 180
count
integer
required
Required range: x >= 1
timeout
integer
default:300
Required range: 20 <= x <= 1500
keyword
string | null
order_method
enum<string>
default:delivery
Available options:
delivery,
pickup
sort
enum<string>
default:recommended
Available options:
recommended,
distance,
fastest,
rating,
price_low,
price_high
cuisines
enum<string>[]
Available options:
Alcohol,
American,
Asian,
BBQ,
Bagels,
Bakery,
Bodegas,
Bubble Tea,
Burgers,
Chicken,
Chinese,
Coffee,
Dessert,
Fast Food,
Gluten-Free,
Hawaiian,
Healthy,
Indian,
Italian,
Japanese,
Kids Menu,
Korean,
Local Gems,
Mediterranean,
Mexican,
Noodles,
Pizza,
Sandwiches,
Seafood,
Shakes,
Smoothies,
Soup,
Steak,
Sushi,
Thai,
Vegan,
Vegetarian,
Vietnamese
price_max
integer | null
Required range: 1 <= x <= 4
top_rated
boolean
default:false
under_30_min
boolean
default:false
offers
boolean
default:false
free_delivery
boolean
default:false
grubhub_plus
boolean
default:false
open_now
boolean
default:false
new_only
boolean
default:false
national_brands
boolean
default:false
alcohol
boolean
default:false
order_tracking
boolean
default:false
shared_cart
boolean
default:false

Response

Successful Response

id
string
required
@type
string
default:GrubhubSearchRestaurant
name
string | null
url
string | null
alias
string | null
brand_name
string | null
chain_name
string | null
image
string | null
cuisines
string[]
rating
number | null
rating_count
integer | null
price_rating
integer | null
coupon_count
integer
default:0
delivery_fee
number | null
delivery_minimum
number | null
delivery_time
integer | null
delivery_time_min
integer | null
delivery_time_max
integer | null
distance
number | null
open
boolean
default:false
delivery
boolean
default:false
pickup
boolean
default:false
is_new
boolean
default:false