# Goofish (闲鱼 Xianyu) Scraper - Search Listings + Item Details (`lanternlab318/goofish`) Actor

- **URL**: https://apify.com/lanternlab318/goofish.md
- **Developed by:** [Lantern Lab](https://apify.com/lanternlab318) (community)
- **Categories:** E-commerce, Lead generation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.99 / 1,000 listings

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?

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

## Goofish (闲鱼 Xianyu) Scraper - Search Listings + Item Details

Search **Goofish (闲鱼 / Xianyu / Idlefish)**, China's largest second-hand marketplace, by keyword and get every listing back with its **title, price, original price, want count (想要), location, seller nickname, publish time and photos**. Turn on `includeDetail` to add the item page: **full description, condition (成色), view count, favourites, item status, category and attributes** (brand, model, storage...). No Goofish login, no cookies of yours.

**Price:** $5.99 per 1,000 listings, item details included. Partial rows, search-term status rows and the run summary are free, and so is a search term that finds nothing.

### Quick example

Input:

```json
{
  "searchQueries": ["复合肥", "iPhone 15"],
  "maxItems": 60,
  "includeDetail": true
}
```

One listing row (`recordType: "listing"`, shortened):

```json
{
  "recordType": "listing",
  "itemId": "689378339669",
  "url": "https://www.goofish.com/item?id=689378339669",
  "title": "三安史丹利农用复合肥厂家直销农用化肥种菜家用种地用有机肥花肥",
  "price": 19.99,
  "priceText": "¥19.99",
  "originalPrice": null,
  "currency": "CNY",
  "wantCount": 351,
  "city": "山东",
  "sellerNick": "北朝洗耳恭听的苏木",
  "publishedAt": "2022-10-22T14:00:48.000Z",
  "imageUrls": ["https://img.alicdn.com/bao/uploaded/i3/O1CN01gLFwWz2BWWLwZ9N1Z_!!0-fleamarket.jpg"],
  "tags": [],
  "description": "三安史丹利农用复合肥厂家直销 ... 复合肥19-19-19 【10斤】19.9元包邮 ...",
  "condition": null,
  "viewCount": 4299,
  "favoriteCount": 63,
  "itemStatus": "在线",
  "sellerCity": "济南",
  "category": "复合肥",
  "properties": [{ "name": "分类", "value": "复合肥" }],
  "shippingFee": 0,
  "detailStatus": "ok",
  "query": "复合肥",
  "page": 1,
  "rank": 1,
  "partial": false,
  "partialReason": null,
  "collectedAt": "2026-10-24T03:10:12.411Z"
}
```

### Limits

- **At most about 1,500 listings per search term.** Goofish shows 30 listings per page and its pager stops at page 50. Ask for more and the term ends there; the `query_status` row says whether Goofish had more (`moreAvailable`).
- **`city` is the location on the search card**, usually a province or a municipality (for example 山东, 上海). The seller's city (`sellerCity`, for example 济南) comes from the item page and needs `includeDetail`.
- **`price` is the asking price.** For a listing with several options (for example 10斤 / 20斤 bags) it is the lowest one, where the item page shows a range such as ¥9.9 - 18.9. Coupon prices a shop shows on the item page (券后价) are not applied.
- **`wantCount` is null when the card shows no "N人想要" label.** With `includeDetail` it is the exact number from the item page, including 0.
- **`condition` is filled only when the seller picked one.** Many listings, especially shop-style ones, have none.
- **Goofish's anti-bot check sometimes refuses a search.** The Actor never solves a slider. It retries once from a fresh browser on a new IP; if Goofish refuses again, that term is written as `partial: true`, `partialReason: "blocked"`, which never means "no listings".
- **Search text with markup characters or emoji** (`< > & 😀`) is refused by Goofish itself; that term is reported as `partialReason: "query_rejected"`.
- About 20 seconds for a term's first page and about 5 seconds per further page: search runs in a real browser on a mainland-China residential IP, which is the only way Goofish answers it. Item details add about 2-3 seconds per listing (measured: 180 listings with details in about 9 minutes).
- Public data only: the seller's public nickname and city. No names, phone numbers or other personal contact details are collected.
- No scheduling or monitoring built in; use Apify schedules.

### What it does

1. Opens goofish.com once in a real Chrome browser on Apify's residential proxy (China), then types each search term into the site's own search box and pages through the results with the site's own pager. Each page's listings are read from the site's own data, not scraped from HTML. Images, fonts and video are never downloaded.
2. With `includeDetail`, reads each listing's item page data directly, which adds the description, condition, views, favourites, status, category, attributes, seller city and all photos.
3. Writes one row per listing, **deduplicated across all your search terms**: a listing found by two terms is written and charged once.
4. Writes one free `query_status` row per term and a `RUN_SUMMARY` row at the end.

### Input

| Field | Default | What it does |
| --- | --- | --- |
| `searchQueries` | required | Search terms, Chinese or English, one per line (up to 100). |
| `maxItems` | 30 | Listings per search term (up to 1,500). |
| `includeDetail` | false | Add the item page fields. |
| `maxUpstreamRequests` | derived | Hard ceiling on requests to Goofish; leave empty to derive one from your input. |
| `proxyConfiguration` | Residential, China | Proxy for the search browser. Goofish search answers mainland-China residential IPs only. |

### Output

Every row has a `recordType`:

- `listing` - one per listing. `partial: true` (free) means the listing was found but its item page could not be read; `partialReason` is `item_not_found` (removed since it was listed) or `detail_unavailable`, and `detailStatus` gives the cause.
- `query_status` - one per search term: `itemsReturned`, `itemsCharged`, `duplicatesSkipped`, `pagesRead`, `moreAvailable`, and `partial` / `partialReason` (`blocked`, `query_rejected`, `upstream_request_cap`, `charge_limit_reached`, `upstream_error`, `not_collected`) with a plain-language `statusText`.
- `RUN_SUMMARY` - totals for the run, also stored under the `RUN_SUMMARY` key of the run's key-value store.

`publishedAt` is Goofish's publish time; `collectedAt` is when this run read the listing. Prices are in CNY.

# Actor input Schema

## `searchQueries` (type: `array`):

One Goofish search term per line, in Chinese or English, the way sellers write their listings (for example "iPhone 15", "复合肥", "二手相机"). Every term is searched separately and its rows are labelled with it. A listing that matches several terms is returned once and charged once. Markup characters such as < > & and emoji make Goofish refuse the term; the run then says so for that term.

## `maxItems` (type: `integer`):

Upper bound on the listing rows one search term may produce. Goofish shows 30 listings per page and at most 50 pages, so a term never yields more than about 1,500 listings; a value above that does not reach more.

## `includeDetail` (type: `boolean`):

Also read every listing's item page: full description, condition (成色), view count, favourite count, item status, category, attributes (brand, model, storage...), the seller's city and all photos. Adds about 2-3 seconds per listing. A listing whose item page cannot be read is still written, marked partial with the reason, and not charged.

## `maxUpstreamRequests` (type: `integer`):

Hard ceiling on the requests this run sends to Goofish: search pages, item pages and retries together. At the ceiling collection stops - the terms not reached are written with partialReason "upstream_request_cap" and the run then ends normally. Leave empty and the Actor works a ceiling out from your search terms and limits, so a run is never unbounded.

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

The proxy the search browser goes through. Goofish search only answers mainland-China residential IPs, so the default (Apify Proxy, residential, China) is what this Actor is measured on; other choices are likely to be refused. Item details always go through Apify's datacenter proxy.

## Actor input object example

```json
{
  "searchQueries": [
    "iPhone 15"
  ],
  "maxItems": 30,
  "includeDetail": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "CN"
  }
}
```

# Actor output Schema

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

No description

## `runSummary` (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 = {
    "searchQueries": [
        "iPhone 15"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "CN"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("lanternlab318/goofish").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 = {
    "searchQueries": ["iPhone 15"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "CN",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("lanternlab318/goofish").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 '{
  "searchQueries": [
    "iPhone 15"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "CN"
  }
}' |
apify call lanternlab318/goofish --silent --output-dataset

```

## MCP server setup

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

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/CuxFSEFGGx4u5fHA2/builds/brQ8hfn6GaocuhD5x/openapi.json
