G2 Product comparison API
Temporarily unavailable
We are restoring this capability. Until then calls usually fail or return no results; failed calls and empty results are not charged.
API health
- 24h health
- Normal
- 24h average time
- —
- Healthy / normal
- Available
- Limited
- Mostly down
Last 24 hours
Last 30 days
Compare the G2 products named in slugs on one comparison page, with each product's rating and review count, ratings by dimension and the alternatives the page suggests. Slugs are joined with -vs- into the page path, or pass a ready-made combined_slug instead.
G2 Product comparison reads one G2 comparison page, the side-by-side view of software products, and returns the page url, its combined_slug, the product entries in products with product_count, the rating details broken down by dimension in ratings, and the alternative products the page suggests in alternatives_shown, each with its slug, name and link. Software buyers use it to see where products differ dimension by dimension, and product marketers use it to track how their product scores against named rivals.
Name the products in slugs, or point at a comparison page you already have with combined_slug or url. The returned combined_slug is the comparison's combined slug, the part of the address after /compare/, so store it with the date of each call to set later readings of the same page against earlier ones.
Price $1.39 per 1,000 requests ($0.001389 per call). Failed calls and empty results are not charged. Synchronous. For slow jobs add "mode": "async" to the body, take the job_id and poll.
AI prompt
Paste this into your AI assistant. It already holds this endpoint's parameters, response fields and an example request, so the assistant can ask what you need and then write the scraper.
Please help me write a data collection script with the EveryInfra G2 Product comparison endpoint (g2/compare).
Endpoint contract:
- Request: POST https://api.everyinfra.com/api/v1/social with the header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable and never hard-code it.
- In the request body, set platform to g2 and action to compare, and put the parameters inside params.
- Required parameters:
- slugs: Specifies an array of product slugs or product URLs for the compare action, which are automatically joined with -vs- to construct the G2 comparison path.
- Optional parameters:
- combined_slug: Specifies the pre-joined comparison path slug following /compare/ for the compare action, taking precedence over auto-generated slug arrays.
- url: Specifies the target G2 resource URL or bare slug. For profile, reviews, and alternatives, pass a /products/<slug> URL or product slug; for vendor, pass a /sellers/<slug> URL or seller slug.
- Returns one object. Main fields: url, combined_slug, product_count, products, ratings, alternatives_shown.
- Example request body:
{
"platform": "g2",
"action": "compare",
"params": {}
}
- Price: $1.39 per 1,000 requests; failed and empty results are not charged.
- For dozens or hundreds of targets, add "mode": "async" to the body: you get a job_id at once and poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} for the result.
- On 422, fix the request using the suggested parameter names and allowed values in the error; on 429 or 503, wait for Retry-After and try again.
Before writing code, ask me which targets I need, how many, which fields, and what output format I want; then confirm the plan and the rough cost with me.Request parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
Authorization | header | string | Yes | - | Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository. |
platform | body | string | Yes | g2 | Platform identifier, fixed value. |
action | body | string | Yes | compare | Capability identifier, fixed value. |
slugs | body.params | Not declared | Yes | - | Specifies an array of product slugs or product URLs for the compare action, which are automatically joined with -vs- to construct the G2 comparison path. This parameter does not execute separate parallel queries or accept vendor names; choose product combinations with existing G2 comparison pages. |
combined_slug | body.params | Not declared | No | - | Specifies the pre-joined comparison path slug following /compare/ for the compare action, taking precedence over auto-generated slug arrays. It does not accept single vendor-and-product identifiers, and passing an explicit url parameter takes higher precedence. |
url | body.params | Not declared | No | - | Specifies the target G2 resource URL or bare slug. For profile, reviews, and alternatives, pass a /products/<slug> URL or product slug; for vendor, pass a /sellers/<slug> URL or seller slug. For compare, passing a full /compare/ URL overrides auto-generated paths, though the required slugs parameter must still be supplied. |
Code samples
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
-H "Authorization: Bearer $EVERYINFRA_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"platform": "g2",
"action": "compare",
"params": {}
}'[OpenAPI definition (JSON)]Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.
Response example
There is no real sample for these example parameters yet: this shows the response shape and fields from the contract, with … as placeholders. It is not the result of a real call.
{
"id": "req_…",
"platform": "g2",
"action": "compare",
"results": {
"url": …,
"combined_slug": …,
"product_count": …,
"products": …,
"ratings": …,
"alternatives_shown": …,
"platform": …
},
"billing": {
"charged": …,
"charged_usd": …,
"balance_after_usd": …,
…
},
"quota": { … }
}Response fields
Business data is in results. The table lists the fields a record can contain; values the platform does not show are never made up.
| Field | Meaning |
|---|---|
url | Link to the record on the platform. |
combined_slug | Keeps the platform's own meaning |
product_count | Keeps the platform's own meaning |
products | Keeps the platform's own meaning |
ratings | Keeps the platform's own meaning |
alternatives_shown | Keeps the platform's own meaning |
platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |
FAQ
How do I name the products to compare?
Put them in slugs as an array of strings, one per product, using each product's G2 slug, the part after /products/ in its G2 link, or the full product URL. The slugs are joined with -vs- to build the address of the comparison page. G2 Search returns product links you can take the slugs from.
Which input wins if I send more than one?
The full comparison url comes first, then combined_slug, the part of the address after /compare/, and only then slugs. Send just one of them to keep the request clear; if you copied a comparison page from your browser, pass it whole as url and leave out the slugs.
What does ratings contain?
ratings holds the rating details the comparison page breaks down by dimension, so you can see where products differ instead of relying on one overall score. Read it next to alternatives_shown, the alternative products the page suggests beyond the ones you named; each comes with a slug you can pass to G2 Reviews.
Errors and billing
- 401
- Missing or invalid key. Authentication runs before parameter checks, so unauthenticated requests never see the parameter schema.
- 422
- Wrong parameter name or value. The error lists the parameters and allowed values this capability accepts and the closest match; it happens before any charge.
- 402
- Insufficient balance. Top up first.
- 429
- The account's per-minute request limit was reached (all of its API keys count together; a key's own lower limit applies first). Wait for Retry-After and try again; a rate package in the console raises the limit.
- 503
- Could not complete right now. Any charge for the call goes back to your balance automatically, and the billing receipt in the response states the actual outcome, including when it is not yet known. Do not resend blindly.
- 200 empty
- The request completed without data and is not charged (billing.reason = empty_result_refunded).