# Market Expansion Agent (`apify/market-expansion-agent`) Actor

Use AI to help you plan your business’ expansion. Market Expansion Agent analyzes data from Google Maps and social media data to identify market gaps and recommend optimal locations for the next step in your business’ evolution.

- **URL**: https://apify.com/apify/market-expansion-agent.md
- **Developed by:** [Apify](https://apify.com/apify) (Apify)
- **Categories:** AI, Agents
- **Stats:** 93 total users, 0 monthly users, 85.4% runs succeeded, 6 bookmarks
- **User rating**: 1.48 out of 5 stars

## Pricing

$7.00 / 1,000 single competitor ai analyses

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 📍 Market Expansion AI Agent

**Market Expansion Agent** is an AI-powered location intelligence tool that extracts data from **Google Maps** and **social media**, which it then analyzes to identify business expansion opportunities.

This tool helps you transform raw data into insight by doing the following:

🗺️ Identify underserved geographic areas with expansion potential\
🏢 Analyze competitor density and market saturation\
📊 Discover service gaps in existing markets\
🎯 Receive precise location recommendations

### 📍 What data can the Market Expansion Agent analyze?

**Market Expansion Agent** works by using **Google Maps Scraper** to perform market analysis. **The agent processes and analyzes business rankings, reviews, service categories, location, operating hours, social media presence, contact availability, and price levels**.

The agent then takes this information and provides market expansion recommendations, including:

🏢 Business density and geographic distribution\
🎖️ Key business strength and weakness\
💰 Pricing level gaps and opportunities\
🌐 Digital presence and social media gaps\
👥 Service offering gaps\
⭐ Quality sentiment gaps\
🗺️ Location recommendations\
❗️ Potential challenges

### **⬇️ Input**

To get the best results, provide **clear and specific input data**.

#### ✅ Recommended search input

You can provide **one** of the following:

1. **Market segment + geographic area**

   Use descriptive phrases combining **industry, business type, and target location**. Examples:

   - "vegan restaurants in Berlin, Germany"
   - "coworking spaces in Prague, Czechia"
   - "fitness centers in London, United Kingdom"

   We recommend using a city + country format for best results.

2. **Google Maps URL**

   Alternatively, for better precision, you can provide a direct link to a Google Maps search for your market segment and target area.

   - Example: <https://www.google.com/maps/search/specialty+coffee+shops+in+Prague/>

3. **Coordinates + radius**

   To analyze specific geographic areas, you can combine latitude and longitude, and then add a search radius. The default is 5km, but can be changed.

#### 📊 Data volume guidelines

To get the best possible insight at manageable cost, we recommend the following search parameters:

- 15–30 businesses
- Up to 100 reviews per business

```json
{
    "searchStringsArray": ["specialty coffee shops in Prague", "artisan coffee Prague"],
    "maxCrawledPlacesPerSearch": 20,
    "includeReviews": true,
    "maxReviews": 100,
    "language": "en",
    "scrapeReviewerName": false,
    "scrapeReviewDate": true
}
```

### ⬆️ Output

The **Market Expansion Agent** delivers output designed to help you identify expansion opportunities.

#### 🧠 Market Expansion Intelligence Report

The AI-generated JSON report includes six sections:

1. **Search query & metadata**

   - Market segment and location
   - Timestamp and data freshness

2. **Competitive landscape overview**

   - Competitor count and distribution
   - Market saturation and density
   - Pricing, services, and sentiment trends

3. **Gap analysis**

   - Underserved areas
   - Any services that could be improved

4. **Location recommendations**

   - One to three high-potential areas with coordinates
   - Explanation with foot traffic insights and risk mitigation

5. **Competitor summary**

   - Profiles with strengths, weaknesses, and social media presence

6. **Analysis metadata**
   - Analysis timestamp, data freshness, and quality indicators

#### 🗺️ Places map

The **Places map** is an HTML-based visualization of the above analysis in map form.

**Features:**

- Interactive view of competitor locations
- AI-generated business summaries
- Easy navigation and visualization

Access the map via the `places-map` key in the key-value store from your Apify run results.

<img width="100%" src="https://i.imgur.com/IL42j4D.png"/>

#### 📁 Supporting raw data

The data used by the agent comes from the following Actor in Apify Store:

- [**Google Maps Scraper**](https://console.apify.com/actors/nwua9Gu5YrADL7ZDj/input): business info, reviews, contact details, and social media profiles

The retrieved data can be found in the following places:

- **Dataset tab**: structured data
- **Key-value store**: final JSON report
- **Run log**: traceability

Output example:

```json
[
    {
        "searchQuery": {
            "marketSegment": "restaurant",
            "geographicArea": "Prague"
        },
        "analysisTimestamp": "2024-06-15T12:00:00Z",
        "dataFreshness": {
            "googleMapsScrapedAt": "2024-06-10T08:00:00Z",
            "socialMediaScrapedAt": "2024-06-10T08:00:00Z"
        },
        "competitiveLandscapeOverview": {
            "competitorCount": 15,
            "densityAndDistributionDescription": "Competitors are distributed across various Prague districts including Prague 9, 14, 22, and Benice, with some clustering near family-friendly and accessible locations such as hotels and shopping centers. The distribution shows a mix of traditional Czech, Asian, Eastern European, and casual fast food restaurants, with several family- and group-oriented venues. Some competitors are located near sports or wellness facilities, while others are positioned in residential or commercial zones. Overall, the market shows moderate density with pockets of concentration in family- and tourist-friendly neighborhoods.",
            "dominantCharacteristics": {
                "commonPricePoints": [
                    "Mid-range ($$)",
                    "Affordable to moderate pricing",
                    "Some slightly premium pricing for quality or specialty cuisine"
                ],
                "commonServiceOfferings": [
                    "Dine-in, takeout, and delivery options",
                    "Outdoor seating prevalent among family-friendly and casual venues",
                    "Wheelchair accessibility common",
                    "Family-friendly amenities including kids' menus and play areas",
                    "Bar and alcoholic beverage offerings including beer and cocktails",
                    "Reservation acceptance common"
                ],
                "prevalentGMBReviewSentiment": [
                    "Mostly Positive with ratings between 4.3 and 4.8 stars for top competitors",
                    "Neutral to mixed sentiment for some casual and fast food venues",
                    "Recurring themes of inconsistent food quality and service delays in several restaurants"
                ],
                "typicalSocialMediaActivity": "Generally low to moderate; most competitors maintain a Facebook presence with follower counts ranging from 100 to 2300. Instagram presence is limited or weak for many, with few active accounts and low engagement. TikTok and other platforms are largely unutilized. Content strategies are often basic, with limited posting frequency and engagement. Some brands run Facebook ads but lack multi-platform digital marketing."
            },
            "marketSaturationAssessment": "Moderately competitive market with a diverse range of restaurant types and service offerings. Family-friendly and traditional Czech cuisine segments are well represented, while niche cuisines like Indian, Ukrainian, and halal American fast food have fewer competitors but face quality and digital presence challenges. Digital engagement is generally underdeveloped, indicating opportunities for new entrants with strong online strategies. Geographic gaps exist in some Prague districts, and service quality inconsistencies suggest room for differentiation."
        },
        "gapAnalysis": {
            "geographicGaps": [
                {
                    "areaDescription": "Prague 14 and Prague 22 districts show fewer competitors with strong digital presence and family-friendly amenities.",
                    "reasoning": "Several restaurants in these areas have limited or no social media activity and inconsistent service quality, indicating underserved digital engagement and customer experience."
                },
                {
                    "areaDescription": "Central tourist-heavy zones have limited mid-range family-friendly restaurants with outdoor seating and pet-friendly policies.",
                    "reasoning": "Competitors with these features are sparse, suggesting opportunity to capture tourists and locals seeking casual, accessible dining with unique amenities."
                }
            ],
            "serviceOfferingGaps": [
                {
                    "gapDescription": "Limited vegetarian and vegan menu options across many restaurants.",
                    "supportingEvidence": "Multiple competitors noted lack of vegetarian choices or limited plant-based offerings, reducing appeal to health-conscious and diverse dietary customers."
                },
                {
                    "gapDescription": "Inconsistent delivery and takeout quality, especially for niche cuisines.",
                    "supportingEvidence": "Indian, Asian, and halal fast food venues report mixed reviews on delivery timeliness and food quality, indicating opportunity for reliable service differentiation."
                },
                {
                    "gapDescription": "Underutilization of multi-platform digital marketing and content diversity.",
                    "supportingEvidence": "Most competitors rely on Facebook with minimal Instagram or TikTok presence, missing younger demographics and visual storytelling opportunities."
                }
            ],
            "qualitySentimentGaps": [
                {
                    "gapDescription": "Recurring negative themes around inconsistent food quality and seasoning.",
                    "implicationForNewBusiness": "Ensuring consistent, high-quality food preparation can build strong reputation and customer loyalty."
                },
                {
                    "gapDescription": "Service quality issues including slow, chaotic, or unfriendly staff.",
                    "implicationForNewBusiness": "Investing in staff training and operational efficiency can differentiate the brand and improve customer satisfaction."
                },
                {
                    "gapDescription": "Confusing or inaccurate opening hours and unexpected closures.",
                    "implicationForNewBusiness": "Clear communication and reliable operations enhance trust and reduce customer frustration."
                }
            ],
            "digitalPresenceGaps": [
                {
                    "gapDescription": "Underutilization of visual platforms like Instagram and TikTok.",
                    "opportunity": "New entrants can quickly build brand awareness and engagement with high-quality food photography, videos, and influencer collaborations."
                },
                {
                    "gapDescription": "Limited content diversity and low posting frequency on existing social media.",
                    "opportunity": "Regular, interactive content such as polls, stories, and live events can foster community and repeat visits."
                },
                {
                    "gapDescription": "Absence of social media presence for several well-rated restaurants.",
                    "opportunity": "Establishing social profiles can capture untapped digital audiences and improve reputation management."
                }
            ]
        },
        "locationSuggestions": [
            {
                "suggestedAreaName": "Prague 14 - Kyje and surroundings",
                "suggestedAreaDescription": "A residential district with family-oriented neighborhoods, moderate foot traffic, and limited mid-range family-friendly dining options. The area has good accessibility and parking facilities.",
                "representativeCoordinates": {
                    "latitude": 50.1105,
                    "longitude": 14.59
                },
                "reasoningForSuggestion": {
                    "addressesGeographicGap": "This area has fewer competitors with strong digital presence and family-friendly amenities, representing an underserved market segment.",
                    "fillsServiceOfferingGap": "Opportunity to offer consistent quality family dining with vegetarian options and outdoor seating.",
                    "leveragesQualityGap": "By focusing on reliable service and clear communication, a new entrant can differentiate from existing inconsistent competitors.",
                    "exploitsDigitalPresenceGap": "Strong multi-platform social media strategy can capture local families and younger demographics.",
                    "footTrafficPotentialRationale": "Proximity to residential zones and local schools supports steady family and group dining demand.",
                    "otherStrategicAdvantages": "Good parking availability and accessibility by public transport enhance convenience."
                },
                "potentialChallenges": [
                    "Moderate competition from established local eateries.",
                    "Need to build brand awareness in a less tourist-heavy area."
                ]
            },
            {
                "suggestedAreaName": "Prague 9 - Prosek and Vysočany",
                "suggestedAreaDescription": "A mixed-use district with growing residential and commercial developments, attracting young families and professionals. The area has moderate foot traffic and some existing restaurants with limited digital engagement.",
                "representativeCoordinates": {
                    "latitude": 50.11,
                    "longitude": 14.48
                },
                "reasoningForSuggestion": {
                    "addressesGeographicGap": "Competitors here show inconsistent service and limited social media presence, indicating opportunity for a well-managed, digitally savvy entrant.",
                    "fillsServiceOfferingGap": "Introducing diverse menu options including vegetarian and delivery with high quality can meet unmet customer needs.",
                    "leveragesQualityGap": "Operational excellence and transparent communication can build trust in a market with service complaints.",
                    "exploitsDigitalPresenceGap": "Active Instagram and TikTok content can engage younger professionals and families.",
                    "footTrafficPotentialRationale": "Growing residential population and commercial offices provide a steady customer base.",
                    "otherStrategicAdvantages": "Accessibility via public transport and parking options support customer convenience."
                },
                "potentialChallenges": [
                    "Competition from casual dining and fast food venues.",
                    "Need to differentiate through quality and digital marketing."
                ]
            },
            {
                "suggestedAreaName": "Prague 22 - Uhříněves and Benice",
                "suggestedAreaDescription": "Suburban districts with family-friendly environments, wellness and sports facilities, and limited mid-range dining options with strong digital presence. The area attracts locals and tourists visiting wellness hotels and sports clubs.",
                "representativeCoordinates": {
                    "latitude": 50.03,
                    "longitude": 14.65
                },
                "reasoningForSuggestion": {
                    "addressesGeographicGap": "Existing restaurants have limited social media activity and some service inconsistencies, leaving room for a digitally engaged, quality-focused entrant.",
                    "fillsServiceOfferingGap": "Opportunity to offer authentic cuisine with family amenities and accessible dining.",
                    "leveragesQualityGap": "Consistent food quality and attentive service can capture dissatisfied customers.",
                    "exploitsDigitalPresenceGap": "Leveraging Facebook, Instagram, and TikTok can build community and attract wellness tourists.",
                    "footTrafficPotentialRationale": "Proximity to wellness hotels, sports clubs, and residential areas supports diverse customer segments.",
                    "otherStrategicAdvantages": "Ample parking and accessibility enhance customer convenience."
                },
                "potentialChallenges": [
                    "Lower foot traffic compared to central Prague areas.",
                    "Need to educate market on new brand and offerings."
                ]
            }
        ],
        "analyzedCompetitorsSummary": [
            {
                "competitorName": "U2Kuchařů",
                "address": "Prague",
                "overallGMBRating": 3.9,
                "primaryOfferingFocus": "Family-friendly casual dining with outdoor garden seating and bar",
                "socialMediaStrength": "Moderate Facebook presence, no Instagram or TikTok",
                "keyStrength": "Strong family-friendly features and dog-friendly policy with cozy outdoor seating",
                "keyWeakness": "Inconsistent service quality and limited digital engagement"
            },
            {
                "competitorName": "Restaurace Sportklub Kolovraty",
                "address": "Prague",
                "overallGMBRating": 4.7,
                "primaryOfferingFocus": "Casual sports club restaurant with family-friendly environment",
                "socialMediaStrength": "No social media presence detected",
                "keyStrength": "Excellent service and cozy sports atmosphere",
                "keyWeakness": "Limited opening hours and no digital engagement"
            },
            {
                "competitorName": "Daawat Restaurant",
                "address": "Prague 9",
                "overallGMBRating": 3.9,
                "primaryOfferingFocus": "Casual Indian cuisine with delivery and takeout",
                "socialMediaStrength": "No social media presence",
                "keyStrength": "Friendly staff and authentic flavors at reasonable prices",
                "keyWeakness": "Inconsistent food quality and limited digital footprint"
            },
            {
                "competitorName": "Hostinec U Boudů",
                "address": "Kolovraty, Prague",
                "overallGMBRating": 4.5,
                "primaryOfferingFocus": "Traditional Czech cuisine with family and pet-friendly amenities",
                "socialMediaStrength": "Moderate Facebook and Instagram presence",
                "keyStrength": "Excellent food quality and accessibility features",
                "keyWeakness": "Service inconsistency and limited social media diversity"
            },
            {
                "competitorName": "MATOKA",
                "address": "Prague",
                "overallGMBRating": 3.9,
                "primaryOfferingFocus": "Halal-certified American fast food (burgers and cheesesteaks)",
                "socialMediaStrength": "Moderate Facebook presence, inactive Instagram",
                "keyStrength": "Halal certification and friendly staff",
                "keyWeakness": "Inconsistent food quality and operational reliability"
            },
            {
                "competitorName": "ATARI",
                "address": "Prague 22",
                "overallGMBRating": 4.6,
                "primaryOfferingFocus": "Family-friendly Asian restaurant with children's corner",
                "socialMediaStrength": "Moderate Facebook, weak Instagram, no TikTok",
                "keyStrength": "Excellent sushi and family amenities",
                "keyWeakness": "Service delays and modest digital engagement"
            },
            {
                "competitorName": "Arter Restaurant",
                "address": "Prague",
                "overallGMBRating": 3.8,
                "primaryOfferingFocus": "Casual dining with affordable beer and broad beverage selection",
                "socialMediaStrength": "No social media presence",
                "keyStrength": "Affordable beer and casual atmosphere",
                "keyWeakness": "Poor service and no digital engagement"
            },
            {
                "competitorName": "RESTAURANT CAFÉ BAR \"U zastávky\"",
                "address": "Prague 9",
                "overallGMBRating": 4.5,
                "primaryOfferingFocus": "Affordable homemade Czech lunch spot",
                "socialMediaStrength": "No social media presence",
                "keyStrength": "Affordable, fast service and wheelchair accessible",
                "keyWeakness": "Limited hours and no digital presence"
            },
            {
                "competitorName": "Sochi Restaurant",
                "address": "Prague 14",
                "overallGMBRating": 4.3,
                "primaryOfferingFocus": "Authentic Georgian, Russian, and Ukrainian cuisine with live music",
                "socialMediaStrength": "No social media presence",
                "keyStrength": "Authentic cuisine and cozy atmosphere",
                "keyWeakness": "No digital engagement and inconsistent service"
            },
            {
                "competitorName": "Restaurant Litchi",
                "address": "Prague 22",
                "overallGMBRating": 4.1,
                "primaryOfferingFocus": "Accessible Asian dining with diverse menu",
                "socialMediaStrength": "No social media presence",
                "keyStrength": "Accessibility and inclusivity",
                "keyWeakness": "Inconsistent food quality and no digital presence"
            },
            {
                "competitorName": "Švejk restaurant U Karla",
                "address": "Prague 22",
                "overallGMBRating": 4.5,
                "primaryOfferingFocus": "Authentic Czech cuisine with family-friendly amenities",
                "socialMediaStrength": "No social media presence",
                "keyStrength": "Strong local reputation and accessibility",
                "keyWeakness": "No digital engagement and occasional service issues"
            },
            {
                "competitorName": "Tetu Brissy Restaurant",
                "address": "Prague-Benice",
                "overallGMBRating": 4.4,
                "primaryOfferingFocus": "Mid-range dining in wellness hotel with desserts and wine",
                "socialMediaStrength": "Modest Facebook and Instagram presence",
                "keyStrength": "Excellent food and desserts",
                "keyWeakness": "Limited vegetarian options and low social media activity"
            },
            {
                "competitorName": "GAZDA restaurant",
                "address": "Prague 22-Uhříněves",
                "overallGMBRating": 4.4,
                "primaryOfferingFocus": "Authentic Ukrainian cuisine with cozy atmosphere",
                "socialMediaStrength": "No social media presence",
                "keyStrength": "Warm hospitality and authentic dishes",
                "keyWeakness": "Service inconsistencies and no digital engagement"
            },
            {
                "competitorName": "BoogieHouse Restaurant",
                "address": "Prague-Benice",
                "overallGMBRating": 4.6,
                "primaryOfferingFocus": "Family-friendly casual dining with live music and beer garden",
                "socialMediaStrength": "Moderate Facebook presence, no Instagram or TikTok",
                "keyStrength": "Excellent burgers and ribs with live music",
                "keyWeakness": "Limited vegetarian options and narrow social media footprint"
            },
            {
                "competitorName": "U Karla Pension Restaurant",
                "address": "Prague 22",
                "overallGMBRating": 4.8,
                "primaryOfferingFocus": "Authentic homemade Czech cuisine with beer garden",
                "socialMediaStrength": "Small Facebook presence",
                "keyStrength": "Excellent food and friendly service",
                "keyWeakness": "Limited social media activity and minor operational issues"
            }
        ]
    }
]
```

### 💰 Pricing model

This AI Agent uses the Apify pay-per-event (PPE) model. You're charged per competitor analyzed (`P_single`). The final report is **included** in the price.

**Total cost** = `(N * P_single)`

**Underlying actor costs** (billed separately):

- [Google Maps Scraper](https://apify.com/compass/crawler-google-places)

This modular model keeps pricing transparent and scalable.

### 🛠️ Framework & technology

Built using **LangChain**, this agent benefits from:

- Structured workflows with large language models
- Chain-based logic for data processing and insights
- Modular design for scalable geographic analysis

### ❓FAQ

#### How many competitors should I analyze?

For reliable results, analyze **15–30 competitors** with **50–100 reviews each**. Smaller markets may need only **10–15**.

#### Can I track market changes over time?

Yes. Schedule recurring runs (for example, **weekly or monthly**) to monitor trends, new entrants, and opportunities.

#### What types of businesses work best?

Local service businesses on Google Maps: **restaurants, cafés, salons, gyms, coworking spaces**, etc. B2B services may yield fewer insights.

#### How accurate are the location recommendations?

Recommendations are based on **comprehensive analysis**, but should be used to **augment real-world knowledge**, not replace it.

#### Can I compare multiple cities?

Yes. Run **separate analyses** for each city to compare potential for each.

# Actor input Schema

## `searchStringsArray` (type: `array`):

Type what you’d normally search for in the Google Maps search bar, like <b>English breakfast</b> or <b>pet shelter</b>. Aim for unique terms for faster processing. Using similar terms (e.g., <b>bar</b> vs. <b>restaurant</b> vs. <b>cafe</b>) may slightly increase your capture rate but is less efficient.<br><br> ⚠️ Heads up: Adding a location directly to the search, e.g., <b>restaurant Pittsburgh</b>, can limit you to a maximum of 120 results per search term due to <a href='https://blog.apify.com/google-places-api-limits/#%E2%9B%94-what-are-google-maps-limitations-for-scraping'>Google Maps' scrolling limit</a>.<br><br> You can also use direct place IDs here in the format <code>place\_id:ChIJ8\_JBApXMDUcRDzXcYUPTGUY</code>.See the [detailed description](https://apify.com/compass/crawler-google-places#search-terms).

## `locationQuery` (type: `string`):

Define location using free text. Simpler formats work best; e.g., use City + Country rather than City + Country + State. Verify with the <a href='https://nominatim.openstreetmap.org/ui/search.html'>OpenStreetMap webapp</a> for visual validation of the exact area you want to cover. <br><br>⚠️ Automatically defined City polygons may be smaller than expected (e.g., they don't include agglomeration areas). If you need to define the whole city area, head over to the 📡 <b>Geolocation parameters\*</b> section instead to select Country, State, US County, City, or Postal code.<br>For an even more precise location definition (especially when using City name as a starting point), head over to <b>🛰 Custom search area</b> section to create polygon shapes of the areas you want to scrape. Note that 📍 <b>Location</b> settings always take priority over <b>📡 Geolocation\*</b> (so use either section but not both at the same time). <br><br>For guidance and tricks on location definition, check <a href='https://blog.apify.com/google-places-api-limits/#2-choose-the-location-using-regular-toponomy%F0%9F%93%8D'>our tutorial</a>.

## `maxCrawledPlacesPerSearch` (type: `integer`):

Number of results you expect to get per each Search term, Category or URL. The higher the number, the longer it will take. <br><br>If you want to scrape all the places available, <b>leave this field empty</b> or use this section <b>🧭 Scrape all places on the map\*</b>.

## `language` (type: `string`):

Results details will show in this language.

## `categoryFilterWords` (type: `array`):

You can limit the places that are scraped based on the Category filter; you can choose as many categories for one flat fee for the whole field. ⚠️ Using categories can sometimes lead to false negatives, as many places do not properly categorize themselves, and there are over <a href='https://api.apify.com/v2/key-value-stores/epxZwNRgmnzzBpNJd/records/categories'> 4,000</a> available categories which Google Maps has. Using categories might filter out places that you’d like to scrape. To avoid this problem, you must list all categories that you want to scrape, including synonyms, e.g., divorce lawyer, divorce attorney, divorce service, etc. See the [detailed description](https://apify.com/compass/crawler-google-places#categories).

## `searchMatching` (type: `string`):

Restrict what places are scraped based on matching their name with provided 🔍 <b>Search term</b>. E.g., all places that have <b>chicken</b> in their name vs. places called <b>Kentucky Fried Chicken</b>.

## `placeMinimumStars` (type: `string`):

Scrape only places with a rating equal to or above the selected stars. Places without reviews will also be skipped. Keep in mind, filtering by reviews reduces the number of places found per credit spent, as many will be excluded.

## `skipClosedPlaces` (type: `boolean`):

Skip places that are marked as temporary or permanently closed. Ideal for focusing on currently open places.

## `countryCode` (type: `string`):

Set the country where the data extraction should be carried out, e.g., <b>United States</b>.

## `city` (type: `string`):

Enter the city where the data extraction should be carried out, e.g., <b>Pittsburgh</b>.<br><br>⚠️ <b>Do not include State or Country names here.</b><br><br>⚠️ Automatic City polygons may be smaller than expected (e.g., they don't include agglomeration areas). If you need that, set up the location using Country, State, US County, City, or Postal code.<br>For an even more precise location definition (, head over to <b>🛰 Custom search area</b> section to create polygon shapes of the areas you want to scrape.

## `state` (type: `string`):

Set a state where the data extraction should be carried out, e.g., <b>Massachusetts</b> (mainly for the US addresses).<br><br>⚠️ <b>Always combine State with other Location types</b>, otherwise you will scrape the whole state!

## `county` (type: `string`):

Set the US county where the data extraction should be carried out, e.g., <b>Madison</b>.<br><br>⚠️ <b>Always combine US county with other Location types</b>, otherwise you will scrape the whole county!

## `postalCode` (type: `string`):

Set the postal code of the area where the data extraction should be carried out, e.g., <b>10001</b>. <br><br>⚠️ <b>Combine Postal code only with 🗺 Country, never with 🌇 City. You can only input one postal code at a time.</b>

## `customGeolocation` (type: `object`):

Use this field to define the exact search area if other search area parameters don't work for you. See <a href='https://apify.com/compass/crawler-google-places#custom-search-area' target='_blank' rel='noopener'>readme</a> or <a href='https://blog.apify.com/google-places-api-limits/#1-create-a-custom-area-by-using-pairs-of-coordinates-%F0%9F%93%A1' target='_blank' rel='noopener'>our guide</a> for details.

## `startUrls` (type: `array`):

Max 300 results per search URL. Valid format for URLs contains <code>google.com/maps/</code>. This feature also supports uncommon URL formats such as: <code>google.com?cid=\*\*\*</code>, <code>goo.gl/maps</code>, and custom place list URL.

## Actor input object example

```json
{
  "searchStringsArray": [
    "restaurant"
  ],
  "locationQuery": "New York, USA",
  "maxCrawledPlacesPerSearch": 20,
  "language": "en",
  "searchMatching": "all",
  "placeMinimumStars": "",
  "skipClosedPlaces": false
}
```

# 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 = {
    "searchStringsArray": [
        "restaurant"
    ],
    "locationQuery": "New York, USA",
    "maxCrawledPlacesPerSearch": 20,
    "language": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("apify/market-expansion-agent").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 = {
    "searchStringsArray": ["restaurant"],
    "locationQuery": "New York, USA",
    "maxCrawledPlacesPerSearch": 20,
    "language": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("apify/market-expansion-agent").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "searchStringsArray": [
    "restaurant"
  ],
  "locationQuery": "New York, USA",
  "maxCrawledPlacesPerSearch": 20,
  "language": "en"
}' |
apify call apify/market-expansion-agent --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=apify/market-expansion-agent",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/EeGMAdqTak7GV58M2/builds/oW6PQtPfwaydqZIqg/openapi.json
