Search places on Google Maps by keyword and location
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.maps.search({ query: "coffee", near: "Austin, TX", limit: 20 });
console.log(result.data.places);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.maps.search(query="coffee", near="Austin, TX", limit=20)
print(result["data"]["places"])
curl -X POST https://api.stophy.dev/v1/maps/search \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"query":"coffee","near":"Austin, TX","limit":20}'
stophy maps search coffee --near "Austin, TX" --limit 20
{
"success": true,
"data": {
"places": [
{
"id": "abc123",
"placeId": "abc123",
"url": "https://example.com/",
"name": "Example title",
"categories": [
"example"
],
"address": {
"full": "example",
"street": "example",
"city": "example",
"state": "example",
"postalCode": "example",
"country": "us"
},
"location": {
"lat": 1,
"lng": 1
},
"rating": 4.5,
"photos": 1,
"phone": "example",
"website": "https://example.com/",
"description": "A short, readable summary of the result.",
"hoursToday": "example",
"openStatus": "example",
"timezone": "example",
"plusCode": "example",
"thumbnail": "https://example.com/image.jpg",
"reservation": "https://example.com/",
"attributes": [
"example"
]
}
]
},
"creditsUsed": 3,
"requestId": "3b113111-1fee-4c70-bc3f-d24e2a96e938"
}
Endpoints
| Endpoint | Cost |
|---|---|
| Search places on Google Maps by keyword and location | 3 credits per 20 items, at least 3 credits |
| Get a place’s address, hours, rating and contact details | 2 credits |
| Get a place’s reviews | 1 credit per 10 items, at least 1 credit |
| Search flights with prices and times | 3 credits |
| Search hotels, restaurants and attractions | 1 credit |
| Get a place’s rating, ranking and details | 1 credit |
| Get a place’s reviews | 1 credit per 20 items, at least 1 credit |
| Search Airbnb stays by place and dates | 2 credits per 18 items, at least 2 credits |
| Get a listing’s details, amenities and host | 2 credits |
| Get a listing’s available dates | 1 credit |
| Get a listing’s reviews | 1 credit per 25 items, at least 1 credit |
More ways to call it
Search hotels, restaurants and attractions
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.tripadvisor.search({ query: "Eiffel Tower" });
console.log(result.data.results);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.tripadvisor.search(query="Eiffel Tower")
print(result["data"]["results"])
curl -X POST https://api.stophy.dev/v1/tripadvisor/search \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"query":"Eiffel Tower"}'
stophy tripadvisor search "Eiffel Tower"
Search Airbnb stays by place and dates
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.airbnb.search({ location: "Lisbon, Portugal" });
console.log(result.data.listings);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.airbnb.search(location="Lisbon, Portugal")
print(result["data"]["listings"])
curl -X POST https://api.stophy.dev/v1/airbnb/search \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"location":"Lisbon, Portugal"}'
stophy airbnb search "Lisbon, Portugal"
Pass the place id from a Google Maps search, the id from a Tripadvisor search, or the listing URL from an Airbnb search into that source’s other endpoints.