> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stophy.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# eBay search

> Read an ebay.com search page as JSON with the ebay-search parser. $1 per 1,000 calls. Send the page to scrape. Examples in cURL, TypeScript and Python.

Reads an ebay.com search page, like ebay.com/sch/i.html?\_nkw=iphone, and returns a list of products as JSON.

## Make a request

Send the page's URL to [scrape](https://docs.stophy.dev/api-reference/endpoint/scrape.md) with a `json` format that names the parser. Get an API key in the [Quickstart](https://docs.stophy.dev/quickstart).

```bash cURL theme={null}
curl -X POST https://api.stophy.dev/v1/scrape \
  -H "Authorization: Bearer $STOPHY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.ebay.com/sch/i.html?_nkw=iphone+15&_udlo=300&_udhi=800&_sop=15","formats":[{"type":"json","parser":"ebay-search"}]}'
```

```typescript TypeScript theme={null}
const response = await fetch("https://api.stophy.dev/v1/scrape", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.STOPHY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://www.ebay.com/sch/i.html?_nkw=iphone+15&_udlo=300&_udhi=800&_sop=15",
    formats: [{ type: "json", parser: "ebay-search" }],
  }),
});
console.log(await response.json());
```

```python Python theme={null}
import os

import requests

response = requests.post(
    "https://api.stophy.dev/v1/scrape",
    headers={"Authorization": f"Bearer {os.environ['STOPHY_API_KEY']}"},
    json={
        "url": "https://www.ebay.com/sch/i.html?_nkw=iphone+15&_udlo=300&_udhi=800&_sop=15",
        "formats": [{"type": "json", "parser": "ebay-search"}],
    },
)
print(response.json())
```

## Read the response

The parser's data is in `data.json`. Its fields include `results`, `cursor`, `page` and `total`. This sample is cut to the first items.

```json theme={null}
{
  "success": true,
  "data": {
    "json": {
      "results": [
        {
          "id": "168683336290",
          "url": "https://www.ebay.com/itm/168683336290",
          "title": "Apple iPhone 15 128GB (BLACK)",
          "brand": null,
          "description": null,
          "price": {
            "amount": 300,
            "currency": "USD"
          },
          "originalPrice": null,
          "rating": null,
          "reviewCount": null,
          "availability": null,
          "images": [
            "https://i.ebayimg.com/images/g/GhMAAeSwWxpqpV1Z/s-l500.jpg"
          ],
          "categories": [],
          "seller": {
            "id": null,
            "name": "Example user",
            "handle": null,
            "url": null,
            "avatarUrl": null
          },
          "priceMax": null,
          "isPriceHidden": false,
          "shippingCost": null,
          "isPickupOnly": true,
          "totalPrice": {
            "amount": 300,
            "currency": "USD"
          },
          "condition": "Pre-Owned",
          "isAuction": false,
          "bids": null,
          "timeLeft": null,
          "hasBestOffer": true,
          "itemLocation": "United States",
          "quantitySold": null,
          "watchers": 70,
          "sellerFeedbackPercent": null,
          "sellerFeedbackScore": 0
        }
      ],
      "cursor": null,
      "page": 1,
      "total": 4800
    }
  }
}
```

## Options

Send options in the `options` object of the `json` format.

| Option | What it does |
| - | - |
| `auctionsOnly` | Only auctions. With sort endingSoonest this lists auctions about to end; ebay.item then returns what each one sold for. |
| `page` | Page number, starting at 1. |

It also takes `condition`.

## Price

\$1 per 1,000 calls. See [Pricing](https://docs.stophy.dev/account/pricing.md).

## Limits and errors

* The URL must be an ebay.com search page, like ebay.com/sch/i.html?\_nkw=iphone. Any other URL fails with `invalidRequest`.
* The answer comes back in `data.json`. If the page cannot be read, the call fails with an error code from [Errors](https://docs.stophy.dev/api-reference/errors.md).

## Related

* [Pre-built parsers](https://docs.stophy.dev/scrape/prebuilt-parsers) lists every parser.
* [Scrape](https://docs.stophy.dev/scrape/overview) has the options every scrape takes.
* [eBay item](https://docs.stophy.dev/scrape/prebuilt-parsers/shopping/ebay-item.md)
* [Amazon search](https://docs.stophy.dev/scrape/prebuilt-parsers/shopping/amazon-search.md)
* [Amazon product](https://docs.stophy.dev/scrape/prebuilt-parsers/shopping/amazon-product.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.