# eBay Product API

The `eBay Product Page API` endpoint will retrieve product data from an eBay product page (/itm/) and transform it into usable JSON.

{% tabs %}
{% tab title="cURL" %}

```bash
curl --request GET \
--url "https://api.scraperapi.com/structured/ebay/product?\
api_key=API_KEY&country_code=COUNTRY_CODE&tld=TLD&product_id=PRODUCT_ID"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

payload = {
    'api_key': 'API_KEY',
    'product_id': 'PRODUCT_ID',
    'country_code': 'COUNTRY_CODE',
    'tld': 'TLD'
}

r = requests.get('https://api.scraperapi.com/structured/ebay/product',params=payload)

print(r.text)
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
import fetch from 'node-fetch';

fetch(
  'https://api.scraperapi.com/structured/ebay/product?api_key=API_KEY&product_id=PRODUCT_ID&country_code=COUNTRY_CODE&tld=TLD'
)
  .then(response => response.json()) 
  .then(data => {
    console.log(data);
  })
  .catch(error => {
    console.error(error);
  });
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "https://api.scraperapi.com/structured/ebay/product?api_key=API_KEY&product_id=PRODUCT_ID&country_code=COUNTRY_CODE&tld=TLD";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
?>
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'json'

params = {
  :api_key => "API_KEY",
  :product_id => "PRODUCT_ID",
  :country_code => "COUNTRY_CODE",
  :tld => "TLD"
}

uri = URI('https://api.scraperapi.com/structured/ebay/product')
uri.query = URI.encode_www_form(params)

website_content = Net::HTTP.get(uri)
print(website_content)
```

{% endtab %}

{% tab title="Java" %}

```java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        try {
            String apiKey = "API_KEY";
            String product_id   = "PRODUCT_ID";
            String country_code = "COUNTRY_CODE";
            String tld = "TLD";

            String urlStr = "https://api.scraperapi.com/structured/ebay/product?api_key=" 
                            + apiKey + "&product_id=" + product_id + "&country_code=" + country_code + "&tld=" + tld;

            URL url = new URL(urlStr);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");

            int responseCode = conn.getResponseCode();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                StringBuilder response = new StringBuilder();
                String line;
                while ((line = in.readLine()) != null) {
                    response.append(line);
                }
                in.close();
                System.out.println(response.toString());
            } else {
                System.out.println("Error in API Call. Response code: " + responseCode);
            }

        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}
```

{% endtab %}
{% endtabs %}

**Supported Parameters**

<table><thead><tr><th width="246">Parameters</th><th>Details</th></tr></thead><tbody><tr><td><code>API_KEY</code> (required)</td><td>Your API Key.</td></tr><tr><td><code>PRODUCT_ID</code> (required)</td><td>ebay product ID. 12 digits. Example: 166619046796</td></tr><tr><td><code>TLD</code></td><td><p>Top-level Ebay domain to scrape. This is an optional argument and defaults to “com” (ebay.com). Valid values include: </p><p><strong>com</strong> (ebay.com)</p><p><strong>co.uk</strong> (ebay.co.uk)</p><p><strong>com.au</strong> (ebay.com.au)</p><p><strong>de</strong> (ebay.de)</p><p><strong>ca</strong> (ebay.ca)</p><p><strong>fr</strong> (ebay.fr)</p><p><strong>it</strong> (ebay.it)</p><p><strong>es</strong> (ebay.es)</p><p><strong>at</strong> (ebay.at)</p><p><strong>ch</strong> (ebay.ch)</p><p><strong>com.sg</strong> (ebay.com.sg)</p><p><strong>com.my</strong> (ebay.com.my)</p><p><strong>ph</strong> (ebay.ph)</p><p><strong>ie</strong> (ebay.ie)</p><p><strong>pl</strong> (ebay.pl)</p><p><strong>nl</strong> (ebay.nl)</p></td></tr><tr><td><code>COUNTRY_CODE</code></td><td><strong><code>country_code</code></strong> influences the language and the currency of the page. The TLD should be set to ‘com’ if you are using languages that are not used by the TLDs listed above.</td></tr><tr><td><code>OUTPUT_FORMAT</code></td><td><p>For structured data methods we offer CSV and JSON output. JSON is default if parameter is not added. Options:</p><ul><li>csv</li><li>json (default)</li></ul></td></tr></tbody></table>

### Sample Response

```json
  "product_id_epid": "166619046796",
  "title": "Apple AirPods Pro 2nd Generation 2023 A2968 Magsafe USB-C Charging - Excellent",
  "seller": {
    "name": "Amazing Wireless",
    "seller_url": "https://www.ebay.com/str/amazingwireless",
    "seller_reviews_count": 141910,
    "seller_review": "99.4% positive",
    "top_rated": true
  },
  "price": {
    "value": 149.99,
    "currency": "USD"
  },
  "images": [
    "https://i.ebayimg.com/images/g/rm4AAOSwPtJljzDc/s-l1600.webp",
    "https://i.ebayimg.com/images/g/WDgAAOSwr3ZljzDb/s-l140.webp",
    "https://i.ebayimg.com/images/g/RfwAAOSwaj5ljzDb/s-l140.webp",
    "https://i.ebayimg.com/images/g/n5wAAOSwIHNmM9iK/s-l140.webp",
    "https://i.ebayimg.com/images/g/BREAAOSw8XxmM9iK/s-l140.webp",
    "https://i.ebayimg.com/images/g/i~kAAOSw9vRmM9iK/s-l140.webp",
    "https://i.ebayimg.com/images/g/d-IAAOSwrrtmM9iK/s-l140.webp",
    "https://i.ebayimg.com/images/g/F9oAAOSwc79mM9iJ/s-l140.webp",
    "https://i.ebayimg.com/images/g/I2QAAOSwCz5mM9iK/s-l140.webp",
    "https://i.ebayimg.com/images/g/w7EAAOSwu~hiKndx/s-l140.webp"
  ],
  "available_quantity": "More than 10 available",
  "sold_items": "1,866 sold",
  "shipping_costs": {
    "value": 0
  },
  "shipping_notes": "Free 2-3 day shipping",
  "return_policy": "60 days returns. Seller pays for return shipping.",
  "condition": "Excellent - Refurbished",
  "year_manufactured": "2023",
  "brand": "Apple",
  "color": "White",
  "model": "Apple AirPods Pro (2nd generation)",
  "item_specifics": [
    {
      "label": "Seller Notes",
      "value": "“85%+ battery life. The Device is in Excellent Cosmetics. Have been Tested, 100% Functionality. Comes with Accessories.” Read Lessabout the seller notes "
    },
    {
      "label": "UPC",
      "value": "0195949052484"
    },
    {
      "label": "Form Factor",
      "value": "In-Ear Only"
    },
    {
      "label": "Type",
      "value": "Canal Earbud (In Ear Canal)"
    },
    {
      "label": "Number of Earpieces",
      "value": "Double"
    },
    {
      "label": "Wireless Technology",
      "value": "Bluetooth"
    },
    {
      "label": "Connectivity",
      "value": "Bluetooth"
    },
    {
      "label": "MPN",
      "value": "MTJV3AM/A"
    },
    {
      "label": "Features",
      "value": "Active Noise Cancellation, Water-Resistant, Sweat-Proof"
    },
    {
      "label": "Microphone Type",
      "value": "Built-In"
    }
  ],
  "item_description_from_seller_url": "https://vi.vipr.ebaydesc.com/itmdesc/166619046796?t=0&category=80077&seller=amazing-wireless&excSoj=1&ver=0&excTrk=1&lsite=0&ittenable=true&domain=ebay.com&descgauge=1&cspheader=1&oneClk=2&secureDesc=1",
  "rating": 4.4,
  "review_count": 71,
  "rating_count_5stars": 55,
  "rating_count_4stars": 2,
  "rating_count_3stars": 6,
  "rating_count_2stars": 2,
  "rating_count_1star": 6,
  "easy_to_use": 84,
  "well_designed": 84,
  "good_value": 76,
  "reviews": [
    {
      "stars": 5,
      "author": " by luczama66",
      "review_date": "May 29, 2024",
      "title": "First time being an eBay buyer and was super sus about buying an airpod replacement on here. Glad i did tho because the airpod works just fine. You ca",
      "content": "First time being an eBay buyer and was super sus about buying an airpod replacement on here. Glad i did tho because the airpod works just fine. You can obviously tell it’s used bc it has small scratches but it isn’t a big deal for me. I liked how it came with written instructions on how to reset it even for different airpod generations! Worth the price too. ",
      "attrs": [
        {
          "label": "Verified purchase",
          "value": "Yes"
        },
        {
          "label": "Condition",
          "value": "Pre-Owned"
        },
        {
          "label": "Sold by",
          "value": "pezzs_inc"
        }
      ]
    },
    {
      "stars": 3,
      "author": " by kz9f424",
      "review_date": "May 05, 2024",
      "title": "They are definitely clones of AirPods Pros 2nd Gen as I noticed a few features are either missing or disabled. That and the name they have when first ",
      "content": "They are definitely clones of AirPods Pros 2nd Gen as I noticed a few features are either missing or disabled. That and the name they have when first pairing is literally “Not Your AirPod Pros”. They do sound good though and I can live without conversation awareness and the inability to turn off charging case sounds for the money I saved buying these instead of shelling out money to buy directly from Apple. ",
      "attrs": [
        {
          "label": "Verified purchase",
          "value": "Yes"
        },
        {
          "label": "Condition",
          "value": "Pre-Owned"
        },
        {
          "label": "Sold by",
          "value": "thunder-6325"
        }
      ]
    },
    {
      "stars": 5,
      "author": " by morr.wayn",
      "review_date": "Apr 29, 2024",
      "title": "Apple AirPods Pro (2nd Generation) Wireless Ear Buds USB-C Charging MTJV3AM/A ",
      "content": "Connect and install on my I Phone was as simple as a couple of clicks, so straight foreword. They fit my ears perfectly out of the box, extra tips are included. The sound is far soupier to the other three brands I have tried. It was nice while waiting at the dentist office, listing to music, seated under the TV that was on, the TV was not noticeable as in blocked completely, very nice. These are also less massive that the Sony buds that died on me. Yes I am pleased.",
      "attrs": [
        {
          "label": "Verified purchase",
          "value": "Yes"
        },
        {
          "label": "Condition",
          "value": "New"
        },
        {
          "label": "Sold by",
          "value": "amazing-wireless"
        }
      ]
    },
    {
      "stars": 5,
      "author": " by rambo-lambo65",
      "review_date": "Mar 08, 2024",
      "title": "Lightweight with great features",
      "content": "A little too expensive but they are fantastic",
      "attrs": [
        {
          "label": "Verified purchase",
          "value": "Yes"
        },
        {
          "label": "Sold by",
          "value": "goldstar_tech"
        }
      ]
    },
    {
      "stars": 5,
      "author": " by rolandk51",
      "review_date": "Mar 03, 2024",
      "title": "Great sounding, great fit, quality build. A good choice ",
      "content": "Great sounding earbuds. Fit very nice charge really well in the case. The Case charges well when resting on charging plate. Highly recommend these sound great.",
      "attrs": [
        {
          "label": "Verified purchase",
          "value": "Yes"
        },
        {
          "label": "Condition",
          "value": "New"
        }
      ]
    }
  ],
  "similar_items": [
    {
      "title": "Apple AirPods Pro 2nd Generation with MagSafe Wireless Charging Case (USB‑C)...",
      "url": "https://www.ebay.com/itm/387434387384",
      "image_url": "https://i.ebayimg.com/thumbs/images/g/yFkAAOSwW5Zm-fel/s-l500.jpg",
      "price": {
        "value": 85,
        "currency": "USD"
      },
      "condition": "Pre-owned",
      "shipping_cost": {
        "value": 7.71,
        "currency": "USD"
      },
      "seller_feedback": "Seller with 100% positive feedback"
    },
    {
      "title": "Apple AirPods Pro 2nd Generation 2023 A2968 Magsafe USB-C Charging - SEALED",
      "url": "https://www.ebay.com/itm/176602653143",
      "image_url": "https://i.ebayimg.com/thumbs/images/g/OCUAAOSwh7Bm-clk/s-l500.jpg",
      "price": {
        "value": 174,
        "currency": "USD"
      },
      "condition": "New",
      "shipping_cost": {
        "value": 0
      },
      "watchers": 5
    },
    {
      "title": "Apple AirPods Pro 2nd Generation with MagSafe Wireless Charging Case (USB‑C)...",
      "url": "https://www.ebay.com/itm/395738824335",
      "image_url": "https://i.ebayimg.com/thumbs/images/g/pBMAAOSwWQ1m-NeG/s-l500.jpg",
      "price": {
        "value": 64.14,
        "currency": "USD"
      },
      "condition": "Pre-owned",
      "shipping_cost": {
        "value": 7.71,
        "currency": "USD"
      },
      "watchers": 11
    },
    {
      "title": "Apple AirPods Pro 2nd Generation 2023 A2968 Magsafe USB-C Charging",
      "url": "https://www.ebay.com/itm/335592547939",
      "image_url": "https://i.ebayimg.com/thumbs/images/g/MvIAAOSwJxxm9Eog/s-l500.jpg",
      "price": {
        "value": 119.99,
        "currency": "USD"
      },
      "condition": "New",
      "shipping_cost": {
        "value": 10.6,
        "currency": "USD"
      },
      "seller_feedback": "Seller with 100% positive feedback"
    }
  ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.scraperapi.com/structured-data-endpoints/e-commerce/ebay/ebay-product-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
