For the complete documentation index, see llms.txt. This page is also available as Markdown.

Safeway

Learn how to start scraping Safeway.

With Web Scraper API, you can scrape various types of Safeway 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.

Source
Description

safeway_search

Search page for a search term of your choice.

safeway_product

Product page of a product ID of your choice.

Any other Safeway page can be scraped by passing its url alone, no source needed.

Besides the parameters listed below, you can include additional parameters such as user_agent_type, geo_location, render, and more to customize your scraping request. Read more here.

Request samples

curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "safeway_search",
        "query": "milk",
        "zip_code": "98101"
    }'
import requests
from pprint import pprint

# Structure payload.
payload = {
    'source': 'safeway_search',
    'query': 'milk',
    'zip_code': '98101'
}

# 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

Parameter
Description
Default Value

source

Sets the scraper.

safeway_search

query

The keyword or phrase to search for products.

-

zip_code

ZIP code of the Safeway store area as a string, e.g. "98101". The page shows the store that serves this ZIP code, with its prices and availability. ZIP codes outside Safeway service areas are rejected.

-

- mandatory parameter

Product

Request samples

Request parameter values

Parameter
Description
Default Value

source

Sets the scraper.

safeway_product

product_id

The numeric product ID at the end of the product page URL, e.g. safeway.com/shop/pd/lucerne-milk-half-gallon-container-may-vary/136010013.

-

zip_code

ZIP code of the Safeway store area as a string, e.g. "98101". The page shows the store that serves this ZIP code, with its prices and availability. ZIP codes outside Safeway service areas are rejected.

-

- mandatory parameter

Last updated

Was this helpful?