WebShop explained: the simulated shopping benchmark, its reward and how to run it
Quick answer
WebShop is a simulated online shop with 1.18 million real product listings and 12,087 written instructions, built to train and test agents that search, choose options and buy. Each episode ends with a reward from 0 to 1, and success means exactly 1. The test split has 500 instructions.
| Author | EvalBox editors |
|---|---|
| Published | |
| Last updated |
WebShop is a benchmark and training environment for language agents, built around a simulated online shop. Its paper, "WebShop: Towards Scalable Real-World Web Interaction with Grounded Language Agents", is by Shunyu Yao, Howard Chen, John Yang and Karthik Narasimhan of Princeton University; version 3 is the NeurIPS camera-ready version (arXiv 2207.01206, read 2026-11-26). An agent gets an instruction such as a product description and a price limit, and must search, open products, pick options and buy one that matches.
What does WebShop measure?
WebShop measures whether an agent can turn a written shopping request into the right purchase through several kinds of web page. The paper lists the challenges it tests: "understanding compositional instructions, query (re-)formulation, comprehending and acting on noisy text in webpages, and performing strategic exploration" (WebShop abstract, read 2026-11-26).
Table: WebShop at a glance, from the paper and repository
| Item | Value |
|---|---|
| Products | 1,181,436 scraped product listings in 5 categories |
| Instructions | 12,087, written by crowd workers |
| Split | 10,587 train, 1,000 development, 500 test |
| Human demonstrations | Over 1,600 |
| Page types | Search, results, item and item-detail |
| Actions | search[query] on the search page, click[button] elsewhere |
| Reward | 0 to 1 at the end of the episode |
How does a WebShop episode work?
A WebShop episode is a short walk through four kinds of page, ending in a purchase. The paper defines a state as one of "the search page that contains a search bar, the results page that lists a set of products returned by a search engine, the item page that describes a product, or the item-detail page that shows further information about the product" (WebShop paper, section 3.1, read 2026-11-26).
- The agent reads the instruction and issues a search, such as
search[white blackout shades 66 inches]. - A search engine returns a results page. The paper uses a BM25 index that is "deterministic, which eases imitation learning and result reproducibility".
- The agent clicks a product, reads its description, and selects options such as size or colour.
- The episode ends when the agent clicks buy.
Search is only allowed on the search page; "on all other pages, click is the only action choice". Clicks name a button by its text, "as opposed to the low-level mouse-click actions in previous environments" (same section).
How is WebShop scored?
WebShop is scored with an automatic reward that compares the bought product with what the instruction asked for. Each instruction comes from a target product and records hidden attributes, options and a price limit. The reward is the share of those that the bought product satisfies, multiplied by a type-match term that gives "low reward when y and y* have similar attributes and options but are obviously different types of products" (WebShop paper, equation 1).
The paper reports two metrics:
- Task score: "100×avg. reward" across episodes.
- Success rate: "the portion of instructions where r = 1".
A reward of 1 does not require the exact target product. The authors note that "there could be many items that satisfy the goal", so any item meeting every requirement counts.
What scores did the paper report?
The paper reported a large gap between agents and people on the 500 test instructions.
Table: WebShop results on the test split, from the paper
| Agent | Score | Success rate |
|---|---|---|
| Rule baseline | 45.6 | 9.6% (abstract) |
| Imitation learning | 59.9 | 29.1% |
| Imitation plus reinforcement learning | 62.4 | 28.7% |
| Average human | 75.5 | 50.0% |
| Expert human | 82.1 | 59.6% |
Read 2026-11-26 from arXiv 2207.01206. The largest gap between experts and agents was on options: the paper calls it "the most significant boost" for humans, "a 28% gap", which shows agents "have trouble" choosing the right options.
The authors also tested transfer to two real shopping websites with 100 instructions each, scoring the runs by hand, and found the trained agent beat the rule baseline there too.
How do I run WebShop?
You run WebShop as a Python program with a local search index; a browser is optional. The repository's setup steps (WebShop repository, read 2026-11-26):
- Install Python 3.8.13 and Java.
- Clone the repository and create a virtual environment.
- Run
./setup.sh -d smallfor a 1,000-product subset or./setup.sh -d allfor the full data. The script installs dependencies, downloads product and instruction data and a spaCy model, and builds the search index. - To load all products, edit two default paths in
web_agent_site/utils.py, because "By default the WebShop only loads 1,000 products for a faster environment preview". - For agents, use the text environment through the Gym interface:
import gym
from web_agent_site.envs import WebAgentTextEnv
env = gym.make('WebAgentTextEnv-v0', observation_mode='text', num_products=1000)
- For people, or for agents that work on HTML, start the web version with
./run_dev.shand open the search page on port 3000.
Two details matter for comparable results. The paper trained and evaluated all models in the simple mode and collected human scores in HTML mode, so say which mode you used. And report whether you loaded the 1,000-product subset or all products, because the search results differ.
Why is WebShop still used?
WebShop is still used because it runs offline on one machine, its search engine is deterministic, and it gives a graded reward from 0 to 1 rather than only pass or fail, which suits training agents with imitation and reinforcement learning, as the paper itself did. Its limits are the other side of the same design: four page types, button-level clicks and no logins, so it says little about a real site's layout or about mouse-level control. For benchmarks on full websites, see WebArena and the benchmark table.
Sources (read 2026-11-26)
FAQ
How many tasks does WebShop have?
12,087 crowd-sourced instructions, split into 10,587 for training, 1,000 for development and 500 for test. The paper's human and model results are averaged over the 500 test instructions.
What is the difference between WebShop's score and success rate?
The task score is 100 times the average reward across episodes. The success rate is the share of instructions where the reward is exactly 1, meaning the bought item matched every attribute, option and the price limit.
Does WebShop need a real browser?
No. Models in the paper were trained and evaluated in the simple text mode. An HTML mode serves the same shop as web pages for people, or for agents that work on HTML.
What did humans score on WebShop?
In the paper, expert humans scored 82.1 with a 59.6% success rate, and the average human 75.5 with 50%. The best agent in the paper scored 62.4 with a success rate of about 29%.