# Yelp Business URL Finder (`tri_angle/get-yelp-urls`) Actor

Find the Yelp page of places you already know. Give coordinates, a type such as restaurant or hotel, and optionally a name, and get the matching Yelp business URL, ready to pass to Yelp Review Scraper.

- **URL**: https://apify.com/tri_angle/get-yelp-urls.md
- **Developed by:** [Tri⟁angle](https://apify.com/tri_angle) (Apify)
- **Categories:** Travel
- **Features:** Limited permissions
- **Stats:** 54 total users, 2 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 4.80 out of 5 stars

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Yelp URLs

Finds Yelp places' URLs in a square geographical area.

### Input

To get started, you need an initial point with its geographical coordinates, in degrees, which will be the center of the square.
Then, choose the place type (either `restaurant` or `hotel`) and, optionally, a string to match with the place's name.

The queries must be formatted like this, with the values separated by comma, without white spaces around commas:

```
Latitude,longitude,place-type,match-string
```

Finally, choose the search square size.

Here is a sample input:

```json
{
	"queries": [
		"43.410405,-70.5582322,restaurant,Popeyes Louisiana Kitchen",
		"44.2073275,-69.8277909,restaurant,Popeyes Louisiana Kitchen",
		"43.636905,-70.3363167,restaurant"
	],
	"maxResultsPerQuery": 1,
	"searchSquareSide": 50,
	"matchStringTolerance": 1
}
```

As you can see, `maxResultsPerQuery` is `1`, because we are trying to match exactly some places we already know, and find their URLs on Yelp.
Also, notice that the third query does not provide a string to match. Even if that's the case, we would still like to match a "Popeyes Louisiana Kitchen" in this example.

### Output

Here is a sample output, originated from the previous input:

```json
[
    {
        "query": "43.410405,-70.5582322,restaurant,Popeyes Louisiana Kitchen",
        "url": "https://www.yelp.com/biz/popeyes-louisiana-kitchen-kennebunk-2?osq=Restaurants",
        "id": "UCCKTx1XSAIDFbhSv4NpXA",
        "name": "Popeyes Louisiana Kitchen",
        "lat": 43.41041812342172,
        "lng": -70.5582328739657,
        "nameScore": 0
    },
    {
        "query": "44.2073275,-69.8277909,restaurant,Popeyes Louisiana Kitchen",
        "url": "https://www.yelp.com/biz/popeyes-louisiana-kitchen-west-gardiner?osq=Restaurants",
        "id": "WlBpHoYK7WSeEM8veyK0rw",
        "name": "Popeyes Louisiana Kitchen",
        "lat": 44.207429,
        "lng": -69.827971,
        "nameScore": 0
    },
    {
        "query": "43.636905,-70.3363167,restaurant",
        "url": "https://www.yelp.com/biz/popeyes-louisiana-kitchen-south-portland?osq=Restaurants",
        "id": "iB4r7V69aXnOlb05F23m1g",
        "name": "Popeyes Louisiana Kitchen",
        "lat": 43.6368919,
        "lng": -70.3363024
    }
]
```

Notice that, even if we didn't give a string to match for the third place, we still found a "Popeyes Louisiana Kitchen", which is what we wanted.
That's because if you don't provide a string to match, the scraper will sort the results by distance from the center of the square, giving you the closest results.

# Actor input Schema

## `queries` (type: `array`):

The initial queries made from latitude, longitude, place type ("restaurant" or "hotel") and, optionally, name, separated by comma.

## `maxResultsPerQuery` (type: `integer`):

Maximum number of results to provide for each query.

## `searchSquareSide` (type: `integer`):

The side length, in meters, of the square area where Yelp will look for results.

## `matchStringTolerance` (type: `integer`):

Maximum allowed Levenshtein distance, used to compare strings. Lower means closer (0 = perfect match). A typical value is 1.

## Actor input object example

```json
{
  "queries": [
    "50.08177111814712,14.404632185654782,restaurant,Czech Slovak Restaurant"
  ],
  "maxResultsPerQuery": 10,
  "searchSquareSide": 50,
  "matchStringTolerance": 1
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "queries": [
        "50.08177111814712,14.404632185654782,restaurant,Czech Slovak Restaurant"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tri_angle/get-yelp-urls").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "queries": ["50.08177111814712,14.404632185654782,restaurant,Czech Slovak Restaurant"] }

# Run the Actor and wait for it to finish
run = client.actor("tri_angle/get-yelp-urls").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "50.08177111814712,14.404632185654782,restaurant,Czech Slovak Restaurant"
  ]
}' |
apify call tri_angle/get-yelp-urls --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tri_angle/get-yelp-urls"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/RQ7byNAKauOR5jvYM/builds/u42z8xYOEncOLQgjP/openapi.json
