Example: eBay Item Details

In this example, we will demonstrate how to use the InstantAPI.ai Retrieve API endpoint to scrape detailed information from an eBay listing. We will provide a complete request and explain what each part of the request does. Additionally, we will show the expected response structure.

Complete Request

Here is a complete request to the Retrieve API endpoint:

Request Breakdown

  • webpage_url: The URL of the eBay item you want to scrape.
  • api_method_name: A user-defined name for the API action, in this case, “getItemDetails”.
  • api_response_structure: The expected structure of the APIs response, defined by you. This includes placeholders for the details you want to scrape.
  • api_key: Get your API key.

Expected Response Structure

The expected response structure is defined in the api_response_structure parameter. Here is the formatted version for clarity:

{
  "item_name": "<the item name>",
  "item_price": "<the item price>",
  "item_image": "<the absolute URL of the first item image>",
  "item_url": "<the absolute URL of the item>",
  "item_type": "<the item type>",
  "item_weight": "<the item weight>",
  "item_main_feature": "<the main feature of this item that would most appeal to its target audience>",
  "item_review_summary": "<a summary of the customer reviews received for this item>",
  "item_available_colors": "<the available colors of the item, converted to closest primary colors>",
  "item_materials": "<the materials used in the item>",
  "item_shape": "<the shape of the item>"
}

Example Response

When the request is successfully processed, you can expect a response similar to the following:

{
  "item_name": "Milwaukee 2801-80 M18 18V 1/2\" LED Li-Ion Drill Driver-Bare Tool-Reconditioned",
  "item_price": "$60.00",
  "item_image": "https://i.ebayimg.com/images/g/aW4AAOSwbl5lJdcd/s-l1600.webp",
  "item_url": "https://www.ebay.com/itm/175955440726",
  "item_type": "Drill Driver",
  "item_weight": "2.5 lb",
  "item_main_feature": "Compact design with LED light for visibility in dark areas",
  "item_review_summary": "4.9 out of 5 stars based on 44 ratings, with many users praising its power and compact size.",
  "item_available_colors": "Red",
  "item_materials": "Plastic, Metal",
  "item_shape": "Compact"
}

By following this example, you can easily use InstantAPI.ai to scrape and transform data from various web pages into structured data tailored to your needs.