# Foursquare Venue Scraper (`moving_beacon-owner1/foursquare-venue-scraper`) Actor

Scrapes commercial real estate listings from LoopNet filtering by location through public sitemap feeds. Returns listing IDs, URLs, titles, states, update timestamps, and images, with optional detail enrichment for property address, price, type, size, year built, cap rate, and location data.

- **URL**: https://apify.com/moving\_beacon-owner1/foursquare-venue-scraper.md
- **Developed by:** [Jamshaid Arif](https://apify.com/moving_beacon-owner1) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 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.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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

## LoopNet Listing Scraper

Scrapes commercial-real-estate listings from LoopNet (CoStar). Because LoopNet's search and listing pages are gated by Akamai Bot Manager, the actor harvests the public listings sitemap feeds (`loopnet.com/sitemaps/sitemap_AllNewListings.xml.gz` and `sitemap_AllListings.xml.gz`), which are served without the bot challenge, and filters them by location. Each record has the listing id, URL, address-derived title, US state, last-modified timestamp and hero image. Optionally it also attempts each listing detail page with curl\_cffi Chrome TLS impersonation and parses the embedded JSON-LD (price, address, geo, property facts); when Akamai blocks the attempt the record keeps a `detail_status` note instead of failing.

### Input

| Field | Default | Description |
|---|---|---|
| `location` | `""` | Free-text location filter matched against listing URL slugs, e.g. `Austin, TX` or `TX`. Empty = all locations. |
| `listing_scope` | `new` | `new` = recently-added-listings feed (~30k URLs, 1 chunk); `all` = full corpus (300k+, 11+ chunks). |
| `fetch_details` | `false` | Best-effort JSON-LD detail enrichment per listing (Akamai-gated; works best with residential proxies). |
| `max_results` | `20` | Max listing records (1–2000). |

### Output

```json
{
    "listing_id": "41363015",
    "url": "https://www.loopnet.com/Listing/3305-Steck-Ave-Austin-TX/41363015/",
    "title": "3305 Steck Ave Austin TX",
    "state": "TX",
    "last_modified": "2026-08-14T10:56:28Z",
    "image_url": "https://images1.loopnet.com/i2/UnArUeRc.../114/image.jpg",
    "raw": { "loc": "...", "lastmod": "...", "image": "..." },
    "detail_status": "blocked (HTTP 403)"
}
```

With `fetch_details` succeeding (e.g. via residential proxy), records gain `name`, `description`, `street_address`, `city`, `region`, `postal_code`, `latitude`, `longitude`, `price`, `property_type`, `building_size`, `year_built`, `cap_rate` and a `facts` map.

### Data source

LoopNet public sitemap feeds referenced from `loopnet.com/robots.txt` — no API key needed. Listing detail pages are protected by Akamai Bot Manager (403 / behavioral challenge from datacenter IPs); the detail step degrades gracefully. Scrape politely (built-in delays) and respect LoopNet/CoStar terms of use.

# Actor input Schema

## `location` (type: `string`):

Free-text location filter matched against listing URL slugs, e.g. "Austin, TX", "San Antonio TX", or just "TX" for a whole state. Leave empty for all locations.

## `listing_scope` (type: `string`):

Which LoopNet sitemap feed to harvest: 'new' reads the recently-added-listings feed (one chunk); 'all' walks the full listing corpus (11+ chunks, several hundred thousand URLs).

## `fetch_details` (type: `boolean`):

Also fetch each listing page and parse its JSON-LD for price, address, property facts and geo. LoopNet detail pages sit behind Akamai Bot Manager, so from datacenter IPs these attempts usually get blocked; each record then carries a detail\_status note. Works best with residential proxies.

## `max_results` (type: `integer`):

Maximum number of listing records to return.

## Actor input object example

```json
{
  "location": "Austin, TX",
  "listing_scope": "new",
  "fetch_details": false,
  "max_results": 20
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "location": "Austin, TX",
    "listing_scope": "new",
    "fetch_details": false,
    "max_results": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("moving_beacon-owner1/foursquare-venue-scraper").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 = {
    "location": "Austin, TX",
    "listing_scope": "new",
    "fetch_details": False,
    "max_results": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("moving_beacon-owner1/foursquare-venue-scraper").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 '{
  "location": "Austin, TX",
  "listing_scope": "new",
  "fetch_details": false,
  "max_results": 20
}' |
apify call moving_beacon-owner1/foursquare-venue-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,moving_beacon-owner1/foursquare-venue-scraper"
        }
    }
}

```

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/1Q2c4aViOaCzZu2H1/builds/kKpMHQg96kDndU9UL/openapi.json
