Ebay Product Page API

Scrape eBay product pages into structured JSON/CSV with ScraperAPI in Java. Extract prices, seller info, specs, and reviews by product ID.

This endpoint will retrieve product data from an Ebay product pages (/itm/) and transform it into usable JSON.

try {
String apiKey = "API_KEY";
String product_id = "PRODUCT_ID";
String country_code = "COUNTRY_CODE";
String tld = "TLD";
String url = "https://api.scraperapi.com/structured/ebay/product?api_key=" + apiKey + "&product_id=" + product_id + "&country_code=" + country_code + "&tld=" + tld;
URL urlForGetRequest = new URL(url);
HttpURLConnection connection = (HttpURLConnection) urlForGetRequest.openConnection();
connection.setRequestMethod("GET");
int responseCode = connection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
StringBuffer response = new StringBuffer();
String readLine;
while ((readLine = in.readLine()) != null) {
response.append(readLine);
}
in.close();
System.out.println(response.toString());
} else {
throw new Exception("Error in API Call");
}
} catch (Exception ex) {
ex.printStackTrace();
}
Parameters
Details

API_KEY (required)

User's normal API Key

PRODUCT_ID (required)

ebay product ID. 12 digits. Example: 166619046796

TLD

Top-level Ebay domain to scrape. This is an optional argument and defaults to “com” (ebay.com). Valid values include:

com (ebay.com)

co.uk (ebay.co.uk)

com.au (ebay.com.au)

de (ebay.de)

ca (ebay.ca)

fr (ebay.fr)

it (ebay.it)

es (ebay.es)

at (ebay.at)

ch (ebay.ch)

com.sg (ebay.com.sg)

com.my (ebay.com.my)

ph (ebay.ph)

ie (ebay.ie)

pl (ebay.pl)

nl (ebay.nl)

COUNTRY

country_code 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.

Sample Response

Last updated

Was this helpful?