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

City Market

Learn how to start scraping City Market.

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

citymarket_search

Search page for a search term of your choice.

citymarket_product

Product page of a product ID of your choice.

Any other City Market 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": "citymarket_search",
        "query": "milk"
    }'
import requests
from pprint import pprint

# Structure payload.
payload = {
    'source': 'citymarket_search',
    'query': 'milk'
}

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

citymarket_search

query

The keyword or phrase to search for products.

-

store_id, delivery_zip, fulfillment_type, price_range, brand

Optional localization and filter parameters, see Localization and Filtering.

-

- mandatory parameter

Product

Request samples

Request parameter values

Parameter
Description
Default Value

source

Sets the scraper.

citymarket_product

product_id

The 13-digit product ID, found at the end of the product page URL, e.g. citymarket.com/p/kroger-carbmaster-original-lactose-free-skim-milk/0001111016338.

-

store_id, delivery_zip, fulfillment_type

Optional localization parameters, see Localization and Filtering.

-

- mandatory parameter

Localization and Filtering

City Market shows search results and product availability for a selected store or delivery area. If none of the parameters below is set, the site falls back to a store of its own choice.

Parameter
Applies to
Description
Default

store_id

citymarket_search, citymarket_product

Selects the store. The ID is the division number and the store number from the store's page URL on citymarket.com, joined together: …/stores/grocery/co/woodland-park/gold-hill-woodland-park/620/00431 → 62000431. Required when fulfillment_type is pickup or in_store.

-

delivery_zip

citymarket_search, citymarket_product

ZIP code of the delivery area, e.g. 81601. Required when fulfillment_type is delivery.

-

fulfillment_type

citymarket_search, citymarket_product

Fulfillment method. Available values: pickup, delivery, in_store. pickup and in_store need store_id; delivery needs delivery_zip.

in_store with store_id alone, delivery with delivery_zip alone

price_range

citymarket_search

Price filter, formatted as min_price-max_price with two decimal places, e.g. 2.00-5.00.

-

brand

citymarket_search

Filters the results to one brand, e.g. Fairlife.

-

If fulfillment_type is set without the parameter it needs, the result comes back with status_code 400. A store_id of a store outside City Market, or a delivery_zip outside its delivery area, returns status_code 613.

Last updated

Was this helpful?