Updated Oct 2026

WooCommerce reviews API in Python: product reviews, replies via WordPress

WooCommerce exposes product reviews through its REST API, which is easy; replying is the twist, because a WooCommerce review is a WordPress comment and the reply is another comment, posted through the WordPress API with a different credential. This guide does both with requests, following WooCommerce’s and WordPress’s official docs, which is also how Prisma’s WooCommerce connector works (in beta). The store-platform picture is on e-commerce reviews API.

Shell
pip install requests

Credentials: a consumer key and secret (WooCommerce → Settings → Advanced → REST API, Read is enough to read) and, for replies, a WordPress application password (Users → Profile → Application passwords) of a user who can moderate comments. Everything over HTTPS; permalinks must be on for /wp-json/ to exist.

1. List approved product reviews

Python
import os, requests
from requests.auth import HTTPBasicAuth

STORE = "https://example-store.com"
WC = HTTPBasicAuth(os.environ["WC_CONSUMER_KEY"], os.environ["WC_CONSUMER_SECRET"])

def reviews(**filters):
    page = 1
    while True:
        r = requests.get(f"{STORE}/wp-json/wc/v3/products/reviews", auth=WC, timeout=30,
                         params={"per_page": 100, "page": page, "orderby": "date_gmt", "order": "desc", "status": "approved", **filters})
        r.raise_for_status()
        batch = r.json()
        if not batch:
            break
        yield from batch
        page += 1

for rev in reviews():
    print(rev["id"], rev.get("rating"), rev.get("reviewer"), rev["date_created_gmt"], rev["product_id"], (rev.get("review") or "")[:80], rev.get("product_permalink"))

Fields: id, date_created_gmt, product_id, product_permalink, status, reviewer, reviewer_email (only with a key that may read it), review (HTML), rating (1 to 5, or 0 when the store doesn’t use ratings) and verified. Filters: after/before (ISO dates on creation), product, status (approved, hold, spam, trash). There is no “updated since”: on each sync, re-read the last 90 days and check replies (next step).

2. Read existing replies (child comments)

Approved comments are public on the WordPress API, so this needs no credential:

Python
ids = ",".join(str(r["id"]) for r in recent)   # up to ~100 review ids
r = requests.get(f"{STORE}/wp-json/wp/v2/comments", params={"parent": ids, "per_page": 100, "orderby": "date_gmt", "order": "asc"}, timeout=30)
replies = {}
for c in r.json():
    replies[c["parent"]] = {"text": c["content"]["rendered"], "date": c["date_gmt"]}   # last one wins: the latest reply

3. Reply (WordPress application password)

Python
WP = HTTPBasicAuth(os.environ["WP_USERNAME"], os.environ["WP_APP_PASSWORD"].replace(" ", ""))
review = requests.get(f"{STORE}/wp-json/wc/v3/products/reviews/{rev['id']}", auth=WC, timeout=30).json()
r = requests.post(f"{STORE}/wp-json/wp/v2/comments", auth=WP, timeout=30,
                  json={"post": review["product_id"], "parent": rev["id"], "content": "Thank you, Laura. The new sizing chart is on the product page.", "status": "approved"})
r.raise_for_status()

The reply shows under the review on the product page. Deleting a comment is possible through DELETE /wp/v2/comments/{id} but that’s moderation, not a reply API; treat replies as permanent.

4. The same job through Prisma

Prisma connects a WooCommerce store with its address and consumer key (checked against the store before storing, encrypted), optionally with a WordPress application password for replies, reads approved reviews and their replies, and returns them in the same JSON as Judge.me, Yotpo, Trustpilot, Google and 50+ other platforms, with a webhook per new review.

Python
H = {"Authorization": f"Bearer {os.environ['PRISMA_API_KEY']}"}
r = requests.get("https://api.prismareviews.com/v1/reviews", headers=H, params={"platform": "woocommerce", "has_reply": "false", "limit": 100}, timeout=30)
for rev in r.json()["data"]:
    print(rev["rating"], rev["author"], rev["text"], rev["url"])
requests.post(f"https://api.prismareviews.com/v1/reviews/{rev['id']}/reply", headers=H,
              json={"text": "Thank you, Laura. The new sizing chart is on the product page."}, timeout=30).raise_for_status()

WooCommerce is in beta in Prisma; without the application password the store is read-only and replies return reply_not_supported with the product link. Connection fields: Platforms. A test key returns sample reviews so the code runs now.

FAQ

Which credentials does the WooCommerce reviews API need?

A WooCommerce REST API consumer key and secret (WooCommerce → Settings → Advanced → REST API) with Read permission, sent as HTTP Basic auth over HTTPS. Replying needs a WordPress application password of a user who can moderate comments, because a reply is a WordPress comment, not a WooCommerce object.

Can I reply to WooCommerce product reviews by API?

Yes, as a child comment: POST /wp-json/wp/v2/comments with post set to the product id, parent set to the review id and status approved, authenticated with a WordPress application password. The WooCommerce key alone can’t do it.

Does the WooCommerce reviews endpoint support updated-since filters?

No. It supports after and before on the creation date, status, product and pagination, but nothing for edits or new replies. Re-read recent reviews on each sync and fetch their child comments to see replies.

WooCommerce, Judge.me, Yotpo and Google, one key.

Get API key

2 locations free. Test keys return sample reviews from every platform.

Get your API key in a minute

Free Spark plan: 2 locations, no card. Test keys return sample data on all 62 platforms, so you can build before connecting a real one.