Costco
Learn how to start scraping Costco.
With Web Scraper API, you can scrape various types of Costco pages; below is an overview of all supported scrapers and their respective source values. The response returns the page HTML in content, in the standard response structure described in Realtime and Push-Pull.
costco_search
Search page for a search term of your choice.
costco_product
Product page of a product ID of your choice.
Any other Costco page can be scraped by passing its url alone, no source needed.
Search
Request samples
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
"source": "costco_search",
"query": "paper towels",
"render": "html"
}'import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'costco_search',
'query': 'paper towels',
'render': 'html'
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('USERNAME', 'PASSWORD'),
json=payload
)
# Instead of response with job status and results url, this will return the
# JSON response with the result.
pprint(response.json())Request parameter values
source
Sets the scraper.
costco_search
query
The keyword or phrase to search for products.
-
start_page
Starting page number.
1
render
Enables JavaScript rendering when set to html. Without rendering, Costco search pages are not returned (status 613).
-
- mandatory parameter
Product
Request samples
Request parameter values
source
Sets the scraper.
costco_product
product_id
The product ID from the product page URL, the number before .html, e.g. costco.ca/kirkland-signature-2-ply-paper-towels-12-pack.product.100363149.html.
-
- mandatory parameter
Localization and Filtering
domain
costco_search, costco_product
Costco regional site. Available values: com, ca. Product IDs are specific to each site.
com
Last updated
Was this helpful?