# Swappa Listings Scraper (`muhammadafzal/swappa-listings-scraper`) Actor

Scrape public Swappa marketplace listings for prices, condition, device attributes, seller details, images, and optional detail-page enrichment for resale and inventory research.

- **URL**: https://apify.com/muhammadafzal/swappa-listings-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** E-commerce, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $16.00 / 1,000 swappa listings

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

## Swappa Listings Scraper

Extract public Swappa marketplace listings into a clean dataset for price monitoring, inventory research, resale analysis, and used-device market comparisons. The Actor accepts Swappa product-listing pages and individual public listing URLs, follows pagination, deduplicates by listing code, and can optionally open every detail page.

### What it extracts

| Field group | Examples |
| --- | --- |
| Listing | `listingId`, `productName`, `headline`, `detailUrl`, featured status, badges |
| Price | `price`, `currency`, `priceValidUntil`, availability |
| Device | condition, battery health, storage, color, carrier, model number, GTIN |
| Seller | public display name, profile URL, star rating, rating count, ships-from location |
| Media | card image or full image gallery when detail enrichment is enabled |
| Detail enrichment | seller description, damage disclosure, creation/update/expiry dates |
| Provenance | source URL, scrape timestamp, enrichment status, record warning |

The dataset contains only listing records. Run-level warnings and access diagnostics are written to the `OUTPUT` key-value-store record so they do not pollute the business dataset.

### Free-plan result limit

Verified Apify free-plan runs return at most **5 unique listing records per run**, even if `maxResults` is higher. Upgrade your Apify plan to request more than five records in one run; paid users retain the requested `maxResults` cap.

### When to use it

- Monitor asking prices and inventory for a specific phone, laptop, watch, tablet, camera, or other Swappa product page.
- Compare condition, storage, carrier, color, battery-health, and seller-location distributions.
- Track public listings from a filtered Swappa URL you already use in a browser.
- Enrich a short list of individual listing URLs with seller disclosures and gallery images.

Do not use this Actor for login-only pages, buying or selling actions, account data, messages, CAPTCHA solving, or bypassing access controls. It scrapes public listing information only.

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `startUrls` | array | unlocked iPhone 15 listings | Public `/listings/...` product pages or `/listing/view/...` detail pages on `swappa.com` |
| `maxResults` | integer | `20` | Maximum unique listing records, from 1 to 500 |
| `maxPages` | integer | `3` | Maximum product result pages, from 1 to 20 |
| `includeDetails` | boolean | `false` | Open each listing for description, damage notes, dates, badges, and full images |
| `proxyConfiguration` | object | Apify US proxy group | Browser-session proxy settings; keep the default for reliable Cloudflare access |

#### Fast card-level run

```json
{
  "startUrls": [
    { "url": "https://swappa.com/listings/apple-iphone-15?carrier=unlocked" }
  ],
  "maxResults": 20,
  "maxPages": 2,
  "includeDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["BUYPROXIES94952"],
    "apifyProxyCountry": "US"
  }
}
```

#### Detail-enriched run

```json
{
  "startUrls": [
    { "url": "https://swappa.com/listing/view/LAJB10743" }
  ],
  "maxResults": 1,
  "maxPages": 1,
  "includeDetails": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["BUYPROXIES94952"],
    "apifyProxyCountry": "US"
  }
}
```

With the Apify API, send the same JSON as the Actor run input. Results are available through the default dataset URL exposed in the Actor output schema.

### Output example

```json
{
  "listingId": "LAJB10743",
  "productName": "Apple iPhone 15",
  "brand": "Apple",
  "headline": "iPhone 15 unlocked",
  "description": null,
  "damageDescription": null,
  "price": 335,
  "currency": "USD",
  "priceValidUntil": "2026-09-02",
  "condition": "Good",
  "batteryHealthPercent": 83,
  "storage": "128GB",
  "color": "Black",
  "carrier": "Unlocked",
  "modelNumber": "A2846",
  "gtin": "00784956710571",
  "availability": "InStock",
  "featured": true,
  "imageCount": 5,
  "imageUrls": ["https://static.swappa.com/images/cache/example.jpg"],
  "paymentMethods": ["PayPal"],
  "listingBadges": [],
  "sellerName": "Example Electronics",
  "sellerProfileUrl": "https://swappa.com/user/ABC123/profile",
  "sellerRating": 4.9,
  "sellerRatingCount": 523,
  "sellerLocation": "Houston, TX",
  "dateCreated": null,
  "dateUpdated": null,
  "dateExpires": null,
  "detailUrl": "https://swappa.com/listing/view/LAJB10743",
  "sourceUrl": "https://swappa.com/listings/apple-iphone-15?carrier=unlocked",
  "scrapedAt": "2026-08-29T12:00:00.000Z",
  "detailEnriched": false,
  "warning": null
}
```

Actual listings and prices change continuously. The example illustrates the schema and is not a current offer.

### Pricing

This Actor uses **pay-per-event** pricing. These are the current Apify Store event prices:

| Event | Price (USD) | When it is charged |
|---|---:|---|
| `apify-default-dataset-item` | FREE: $0.02; BRONZE: $0.02; SILVER: $0.02; GOLD: $0.016; PLATINUM: $0.016; DIAMOND: $0.016 | Swappa listing — One unique, schema-valid public Swappa listing written to the default dataset. |
| `apify-actor-start` | $0.005 | Actor Start — Charged when the Actor starts running. Number of events charged depends on Actor memory (one event per GB, minimum one event). — Charged once per run. |

Apify platform usage for this Actor run is included alongside the event prices above; no separate per-run platform-usage fee is passed to users.

This covers Apify platform usage for this Actor run. Other Apify products or usage outside this Actor run may still follow your account plan.

### Reliability and limits

Swappa can return a Cloudflare managed challenge to raw HTTP and direct traffic, so the Actor uses a real browser, coherent cookies and fingerprinting, bounded concurrency, session retirement, and an Apify US proxy group by default. It does not solve CAPTCHAs or defeat access controls. If all permitted sessions are challenged, the run returns zero fabricated records, writes a `BLOCKED` diagnostic to `OUTPUT`, and creates no result events.

Card-level mode is faster and usually needs one page per 50 listings. Detail enrichment adds one browser request per listing and can take materially longer. Results are deduplicated by Swappa listing code. A failed enrichment request preserves the already validated card record with a warning instead of discarding useful public data.

The Actor accepts only HTTPS Swappa product-listing and listing-detail paths. It rejects account, checkout, search, login, help, and unrelated URLs. A maximum of 500 results and 20 result pages keeps runs bounded.

### Legal and responsible use

Use the Actor only for lawful purposes and comply with Swappa's terms, robots policies, applicable privacy laws, and rate limits. Do not use the output for harassment, discrimination, spam, or attempts to identify private individuals. Seller display names and locations are public marketplace data; collect and retain only what your use case requires. Swappa is a trademark of its owner and is not affiliated with this Actor.

### Support

When reporting a problem, include the run ID, a redacted input, whether detail enrichment was enabled, and the `OUTPUT` record. Never post proxy credentials, account cookies, or tokens.

# Actor input Schema

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

Use this for Swappa product listing pages or individual listing pages. Accepts https://swappa.com/listings/... and https://swappa.com/listing/view/LA... URLs. Example: https://swappa.com/listings/apple-iphone-15?carrier=unlocked. Defaults to a live unlocked iPhone listing page; search and account URLs are not accepted.

## `maxResults` (type: `integer`):

Use this to cap unique dataset records across all supplied URLs. Enter an integer from 1 to 500; the default is 20. This is not a page limit. Verified Apify free-plan runs are capped at 5 records per run; upgrade for more.

## `maxPages` (type: `integer`):

Use this to limit pagination for each product-listing crawl. Enter an integer from 1 to 20; the default is 3. Individual /listing/view/ URLs do not consume pagination beyond their own page.

## `includeDetails` (type: `boolean`):

Use this when you need the full seller description, damage notes, listing dates, badges, and all image URLs. Defaults to false for fast card-level results; enabling it makes one extra browser request per listing.

## `proxyConfiguration` (type: `object`):

Use this to keep a consistent US browser session on Swappa. The default uses Apify's available US proxy group because Swappa may challenge direct traffic. Disable only for controlled testing; credentials and raw proxy URLs are not ordinary input fields.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://swappa.com/listings/apple-iphone-15?carrier=unlocked"
    }
  ],
  "maxResults": 20,
  "maxPages": 3,
  "includeDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "BUYPROXIES94952"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

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

Unique public Swappa listing records written to the default dataset.

## `resultsCsv` (type: `string`):

The same listing records exported as CSV.

## `summary` (type: `string`):

Outcome, counts, warnings, and access diagnostics for this run.

## `consoleRun` (type: `string`):

Run status, logs, and storage previews in Apify Console.

# 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 = {
    "startUrls": [
        {
            "url": "https://swappa.com/listings/apple-iphone-15?carrier=unlocked"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/swappa-listings-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 = { "startUrls": [{ "url": "https://swappa.com/listings/apple-iphone-15?carrier=unlocked" }] }

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/swappa-listings-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 '{
  "startUrls": [
    {
      "url": "https://swappa.com/listings/apple-iphone-15?carrier=unlocked"
    }
  ]
}' |
apify call muhammadafzal/swappa-listings-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammadafzal/swappa-listings-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/Ec3NhdBQc1Npxfv6i/builds/uIa2ik5cD46ehZlyj/openapi.json
