NAV
shell ruby

G2 API

The G2 API is built on the jsonapi.org specification.

Authentication

The API requires an authentication token for access. You can generate a token from the integrations page.

If your account does not have permissions to connect to an endpoint, talk to your Account Executive to learn about how to gain access.

Rate Limits

The API has a global rate limit of 100 requests per second. If you exceed that limit your access will be blocked for 60 seconds.

Date format

Use rfc3339 format for all dates when submitting query parameters on your requests. Here are some examples of rfc3339 formatted dates:

2019-10-02T10:00:00-05:00
2019-10-02T15:00:00Z
2019-10-02T15:00:00.05Z

Pagination format

The G2 API enables pagination via page[size] and page[number] query parameters on GET requests to index pages.

The default page size is 10 items, with the maximum page size being 100 on most endpoints - some endpoints will have lower limits and this will be noted in their specific docs.

page[size] Number of results returned per request (default: 10, max: 100)
page[number] When paging through results, page[number] specifies which page you want. (default: 1)

Filtering Collections

The G2 API allows filtering of records by passing along query parameters.

These are some of the filters currently allowed by the API (where relevant).

Index Filters

Arguments Description
updated_at_lt Return objects only updated before
updated_at_gt Return objects only updated since
order The order to return the collection i.e “?order=created_at desc”
page[size] See Pagination (default is 10)
page[number] See Pagination

In addition, each record type has their own specific filters; these filters are covered in their respective sections.

Response Metadata

Every response returned from the G2 API returns some useful pieces of information in the response headers.

Request IDs

Every response will include an X-Request-ID parameter unique to that specific request. If you need to contact us about a specific request, please make sure to include the specific request ID in any communication with us to help speed up investigations.

Shared response fields

Every response that returns a collection will include pagination data in the meta and links objects.

Errors

The G2 API uses the following error codes:

Error Code Meaning
400 Bad Request – You have passed a malformed request
401 Unauthorized – Your API key is incorrect
402 Payment Required – Your subscription has lapsed
403 Forbidden – The resource requested is not available with your permissions
404 Not Found – The specified resource could not be found
414 Request URI too long – You have applied too many filters on a GET request
422 Unprocessable Entity – Your request is invalid
429 Too Many Requests – You are allowed 100 requests per second
500 Internal Server Error – We had a problem with our server. Try again later
503 Service Unavailable (Time out) – The server is overloaded or down for maintenance

Answers

G2 Answers are read-only models. G2 Reviews provide a snapshot of the 4 primary review questions; for the complete review response, you will need to fetch the answers of a Review to get the whole picture.

List

Endpoint

GET /api/v1/answers

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Answer.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/answers
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "988", "type": "answers", "links": { "self": "https://data.g2.com/api/v1/answers/988" }, "attributes": { "value": null, "question_type": "industry", "question_text": "What is your industry when using this product?", "input_type": "dropdown", "product_id": "de84aed0-e093-4060-beec-5c54c8e0b03e", "survey_response_id": 560, "question_id": 1141, "created_at": "2020-10-29T14:00:23.710-05:00", "updated_at": "2020-10-29T14:00:23.710-05:00" }, "relationships": { "survey_response": { "links": { "self": "https://data.g2.com/api/v1/answers/988/relationships/survey-response", "related": "https://data.g2.com/api/v1/answers/988/survey-response" } }, "question": { "links": { "self": "https://data.g2.com/api/v1/answers/988/relationships/question", "related": "https://data.g2.com/api/v1/answers/988/question" } } } } ], "meta": { "record_count": 1, "page_count": 1 }, "links": { "first": "https://data.g2.com/api/v1/answers?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2.com/api/v1/answers?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

Parameters

filter[product_id] Filter answers by the product UUID
page[size] Pagination size (default: 10, max: 100)
page[number] Pagination page
filter[updated_at_gt] Min time for when a record was last updated. Using rfc3339 format.
filter[updated_at_lt] Max time for when a record was last updated. Using rfc3339 format.

Response Fields

value The answer to the question
question_id ID of the question the answer was written for
question_type The type of question
question_text The specific question asked
input_type Input format. i.e. text, dropdown, boolean
product_id UUID of the product the answer was written for
survey_response_id ID of the review the answer was written for
data Returns the results as an array
links This contains the links for remaining result pages with the same parameters. Returned as self, prev, first, next, and last. next and prev may be blank if you are on the first or last page respectively.

Show

Endpoint

GET /api/v1/answers/:id

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Answer.find(id: 'id')
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/answers/989
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": { "id": "989", "type": "answers", "links": { "self": "https://data.g2.com/api/v1/answers/989" }, "attributes": { "value": null, "question_type": "industry", "question_text": "What is your industry when using this product?", "input_type": "dropdown", "product_id": "39c6d92c-b352-46de-aeac-af6606161989", "survey_response_id": 561, "question_id": 1142, "created_at": "2020-10-29T14:00:24.785-05:00", "updated_at": "2020-10-29T14:00:24.785-05:00" }, "relationships": { "survey_response": { "links": { "self": "https://data.g2.com/api/v1/answers/989/relationships/survey-response", "related": "https://data.g2.com/api/v1/answers/989/survey-response" } }, "question": { "links": { "self": "https://data.g2.com/api/v1/answers/989/relationships/question", "related": "https://data.g2.com/api/v1/answers/989/question" } } } } }

Parameters

filter[product_id] Filter answers by the product UUID

Response Fields

value The answer to the question
question_id ID of the question the answer was written for
question_type The type of question
question_text The specific question asked
input_type Input format. i.e. text, dropdown, boolean
product_id UUID of the product the answer was written for
survey_response_id ID of the review the answer was written for

BuyerIntent::Companies

Show

Endpoint

GET /api/v1/ahoy/companies/:id

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::BuyerIntent::Company.find(id: 'id')
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/ahoy/companies/123
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": { "id": "123", "type": "companies", "links": { "self": "https://data.g2.com/api/v1/ahoy/companies/123" }, "attributes": { "name": "Company Name", "legal_name": "Company Name, LLC", "domain": "company-name.com", "domain_aliases": [ ], "external_id": "dc928287-4d09-xxxx-xxxx-xxxxx", "twitter": "CompanyName", "twitter_id": "13133002", "twitter_bio": "Email support@company-name.com", "twitter_followers": 8426, "twitter_following": 3957, "twitter_location": "Boulder, CO", "twitter_site": "", "twitter_avatar": "", "linkedin": null, "facebook": "company-name", "url": "https://www.company-name.com/", "site_title": "Company Name", "site_h1": "", "site_meta": "", "site_author": null, "tags": [ ], "tech": [ ], "description": "", "founded_year": 2006, "location": "", "time_zone": "America/Denver", "utc_offset": -6, "crunchbase": "organization/company-name", "email_provider": false, "company_type": "private", "alexa_us_rank": 1000, "alexa_global_rank": 1234, "market_cap": null, "raised": null, "employees": 100, "employees_range": "51-250", "annual_revenue": null, "street_number": "1234", "street_name": "Company Name Circle", "sub_premise": "100", "city": "Boulder", "state": "Colorado", "state_code": "CO", "postal_code": "12345", "country": "United States", "country_code": "US", "latitude": "", "longitude": "" } } }

Parameters

id Find companies that match provided ids

Response Fields

name Name of company
legal_name Legal name of company
domain Domain of company’s website
domain_aliases List of domains also used by the company
external_id Clearbit ID for company
twitter Company's Twitter username
twitter_id Company's Twitter ID
twitter_bio Company's Twitter bio
twitter_followers Company's Twitter followers count
twitter_following Company's Twitter following count
twitter_location Company's Twitter location
twitter_site Company's Twitter URL
twitter_avatar Company's Twitter logo
linkedin Company's LinkedIn profile
facebook Company's Facebook profile
url URL of company's website
site_title Page title of company's website
site_h1 Page heading of company's website
site_meta Page meta of company's website
site_author Page author of company's website
tags List of market categories
tech List of known technologies used
description Description of the company
founded_year Year company was founded
location Address of company
time_zone The timezone for the company’s location
utc_offset The offset from UTC in hours in the company’s location
crunchbase Crunchbase handle
email_provider If the domain is associated with a free email provider (i.e. Gmail)?
company_type The company’s type, either education, government, nonprofit, private, public, or personal
alexa_us_rank Alexa’s US site rank
alexa_global_rank Alexa’s global site rank
market_cap Market Cap
raised Total amount raised
employees Amount of employees
employees_range Employees range
annual_revenue Annual Revenue (public companies only)
street_number Headquarters street number
street_name Headquarters street name
sub_premise Headquarters suite number
city Headquarters city name
state Headquarters state name
state_code Headquarters two character state code
postal_code Headquarters postal/zip code
country Headquarters country name
country_code Headquarters two character country code
latitude Headquarters latitude
longitude Headquarters longitude

BuyerIntent::EventStreams

View recent visitors to profile pages for a specific company. We only provide the event if our tracking identifies the visitor’s Organization. We send events for direct visits to the Product profile, comparisons, or category page of given product. We also send an event whenever a user views sponsored content. This endpoint provides up to the last 24 hours of events.

List

Endpoint

GET /api/v1/ahoy/remote-event-streams

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::BuyerIntent::EventStream.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/ahoy/remote-event-streams
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "1", "type": "remote_event_streams", "links": { "self": "https://data.g2.com/api/v1/ahoy/remote-event-streams/1" }, "attributes": { "visitor_id": "12345", "url": "", "tag": "products.reviews", "time": "2017-05-19T14:32:33.005-05:00", "title": "", "product_ids": [ ], "category_ids": [ ], "user_location": { }, "organization": "", "created_at": "2017-05-19T14:32:33.005-05:00" }, "relationships": { "company": { "links": { "self": "https://data.g2.com/api/v1/ahoy/remote-event-streams/1/relationships/company", "related": "https://data.g2.com/api/v1/ahoy/remote-event-streams/1/company" } }, "industry": { "links": { "self": "https://data.g2.com/api/v1/ahoy/remote-event-streams/1/relationships/industry", "related": "https://data.g2.com/api/v1/ahoy/remote-event-streams/1/industry" } } } } ], "meta": { "record_count": 0, "page_count": null }, "links": { "first": "https://data.g2.com/api/v1/ahoy/remote-event-streams?page%5Bnumber%5D=1&page%5Bsize%5D=10", "next": "https://data.g2.com/api/v1/ahoy/remote-event-streams?page%5Bnumber%5D=2&page%5Bsize%5D=10" } }

Parameters

page[size] Pagination size (default: 10, max: 25)
filter[start_time] Min time for when an event was stored (created_at). Using rfc3339 format.
filter[end_time] Max time for when an event was stored (created_at). Using rfc3339 format.

Response Fields

visitor_id Session ID for the visitor
url URL of the event's location
tag Specific tag of the event
time The time the event occurred
created_at The time the event was stored
title Name of the event
product_ids List of product names where the event occurred if applicable
category_ids List of category names where the event occurred if applicable
user_location Location of the User
organization Name of the organization received events

BuyerIntent::History

The Buyer Intent History endpoint allows for searching through the activity of buyer intent for a product. Useful for looking at how intent has changed over time, or just to see what has been happening in the past week. Data is grouped by company, and up to a years worth of data can be presented.

List

Endpoint

GET /api/v1/intent-history

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::BuyerIntent::History.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/intent-history
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "120", "type": "intent_histories", "links": { "self": "https://data.g2.com/api/v1/intent-histories/120" }, "attributes": { "company_name": "Example", "company_domain": "example.com", "company_country": "United States", "company_state": "Texas", "total_pageviews": 15, "direct_pageviews": 2, "product_profile_pageviews": 2, "sponsored_content_pageviews": 0, "category_pageviews": null, "comparison_pageviews": null, "competitor_pageviews": null, "visitor_count": null, "intent_score": 100, "activity_level": "high", "buying_stage": "decision", "last_seen_at": "2018-07-17T14:52:21.223Z", "compared_products": [ ] }, "relationships": { "product": { "links": { "self": "https://data.g2.com/api/v1/intent-histories/120/relationships/product", "related": "https://data.g2.com/api/v1/intent-histories/120/product" } }, "company": { "links": { "self": "https://data.g2.com/api/v1/intent-histories/120/relationships/company", "related": "https://data.g2.com/api/v1/intent-histories/120/company" } } } } ], "meta": { "record_count": 2202, "page_count": 221 }, "links": { "first": "https://data.g2.com/api/v1/intent-histories?page%5Bnumber%5D=1&page%5Bsize%5D=10", "next": "https://data.g2.com/api/v1/intent-histories?page%5Bnumber%5D=2&page%5Bsize%5D=10", "last": "https://data.g2.com/api/v1/intent-histories?page%5Bnumber%5D=221&page%5Bsize%5D=10" } }

Parameters

page[size] Pagination size (default: 10, max: 100)
page[number] Pagination page
filter[visit_at_gt] "Visit at greater than." Min time for when the intent activity occurred. Using rfc3339 format.
filter[visit_at_lt] "Visit at less than." Max time for when the intent activity occurred. Using rfc3339 format.

BuyerIntent::TrackProspects

View conversions captured by the ‘Track your Prospects’ tool. A conversion is created whenever someone views a page that has been flagged with a pixel by your team, and also viewed your product on G2. The result will indicate which action occurred first.

List

Endpoint

GET /api/v1/attribution_tracking/remote-conversions

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::BuyerIntent::TrackProspect.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/attribution_tracking/remote-conversions
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "1", "type": "remote_conversions", "links": { "self": "https://data.g2.com/api/v1/attribution-tracking/remote-conversions/1" }, "attributes": { "first_seen": { "occurred_at": "2018-03-01T06:27:46.208-06:00", "scope": "external", "path": "https://example.com/contact-us/" }, "last_seen": { "occurred_at": "2018-03-01T06:28:42.976-06:00", "scope": "internal", "path": "/products/product-id/reviews" }, "saw_first": "external", "isp": false, "industry": "Diversified Consumer Services", "organization": "Example", "external_id": null, "visitor_id": "9b5d03fb-8b06-4270-8aab-49b4ca3bb497" } } ], "meta": { "record_count": 0, "page_count": null }, "links": { "first": "https://data.g2.com/api/v1/attribution-tracking/remote-conversions?page%5Bnumber%5D=1&page%5Bsize%5D=10", "next": "https://data.g2.com/api/v1/attribution-tracking/remote-conversions?page%5Bnumber%5D=2&page%5Bsize%5D=10" } }

Response Fields

timestamp Timestamp when visitor was last seen
scope Internal or external, indicates whether the visitor was last seen on G2.com properties or other sites.
path If the visitor has an internal scope, this is a URL path on G2.com, if the visitor was external, it is a full URL
timestamp Timestamp when visitor was first seen
scope Internal or external, indicates whether the visitor was first seen on G2.com properties or other sites.
path If the visitor has an internal scope, this is a URL path on G2.com, if the visitor was external, it is a full URL
saw_first Indicates whether user was first tracked on a G2.com property or external site.
isp True/False whether visitor's organization is likely an ISP
industry Industry of visitor
organization Organization of visitor
external_id Trackable external ID
visitor_id Session ID for the visitor

Categories

List

Endpoint

GET /api/v1/categories

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Category.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/categories
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "19cd1c5a-58de-45b3-be19-98d6dc8e2eb0", "type": "categories", "links": { "self": "https://data.g2.com/api/v1/categories/19cd1c5a-58de-45b3-be19-98d6dc8e2eb0" }, "attributes": { "name": "test", "slug": "test-ee5c8175-2e4e-48d3-afca-31fed0ddd295", "description": "test", "updated_at": "2020-10-29T14:00:21.364-05:00" }, "relationships": { "products": { "links": { "self": "https://data.g2.com/api/v1/categories/19cd1c5a-58de-45b3-be19-98d6dc8e2eb0/relationships/products", "related": "https://data.g2.com/api/v1/categories/19cd1c5a-58de-45b3-be19-98d6dc8e2eb0/products" } }, "children": { "links": { "self": "https://data.g2.com/api/v1/categories/19cd1c5a-58de-45b3-be19-98d6dc8e2eb0/relationships/children", "related": "https://data.g2.com/api/v1/categories/19cd1c5a-58de-45b3-be19-98d6dc8e2eb0/children" } }, "ancestors": { "links": { "self": "https://data.g2.com/api/v1/categories/19cd1c5a-58de-45b3-be19-98d6dc8e2eb0/relationships/ancestors", "related": "https://data.g2.com/api/v1/categories/19cd1c5a-58de-45b3-be19-98d6dc8e2eb0/ancestors" } }, "descendants": { "links": { "self": "https://data.g2.com/api/v1/categories/19cd1c5a-58de-45b3-be19-98d6dc8e2eb0/relationships/descendants", "related": "https://data.g2.com/api/v1/categories/19cd1c5a-58de-45b3-be19-98d6dc8e2eb0/descendants" } }, "parent": { "links": { "self": "https://data.g2.com/api/v1/categories/19cd1c5a-58de-45b3-be19-98d6dc8e2eb0/relationships/parent", "related": "https://data.g2.com/api/v1/categories/19cd1c5a-58de-45b3-be19-98d6dc8e2eb0/parent" } } } } ], "meta": { "record_count": 1, "page_count": 1 }, "links": { "first": "https://data.g2.com/api/v1/categories?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2.com/api/v1/categories?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

Parameters

slug URL slug of the category
name Name of the category
page[size] Pagination size (default: 10, max: 100)
page[number] Pagination page
filter[updated_at_gt] Min time for when a record was last updated. Using rfc3339 format.
filter[updated_at_lt] Max time for when a record was last updated. Using rfc3339 format.

Response Fields

name Name of the Category
slug URL slug of the category. e.g. https://www.g2.com/categories/:slug
description Short blurb explaining what products fit in this category.
data Returns the results as an array
links This contains the links for remaining result pages with the same parameters. Returned as self, prev, first, next, and last. next and prev may be blank if you are on the first or last page respectively.

Show

Endpoint

GET /api/v1/categories/:id

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Category.find(id: 'id')
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/categories/72225088-0eb9-4139-9642-5f9a944dd8de
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": { "id": "72225088-0eb9-4139-9642-5f9a944dd8de", "type": "categories", "links": { "self": "https://data.g2.com/api/v1/categories/72225088-0eb9-4139-9642-5f9a944dd8de" }, "attributes": { "name": "test", "slug": "test-5b33c6eb-0186-4f8f-a1f6-6504f04e1cdc", "description": "test", "updated_at": "2020-10-29T14:00:18.846-05:00" }, "relationships": { "products": { "links": { "self": "https://data.g2.com/api/v1/categories/72225088-0eb9-4139-9642-5f9a944dd8de/relationships/products", "related": "https://data.g2.com/api/v1/categories/72225088-0eb9-4139-9642-5f9a944dd8de/products" } }, "children": { "links": { "self": "https://data.g2.com/api/v1/categories/72225088-0eb9-4139-9642-5f9a944dd8de/relationships/children", "related": "https://data.g2.com/api/v1/categories/72225088-0eb9-4139-9642-5f9a944dd8de/children" } }, "ancestors": { "links": { "self": "https://data.g2.com/api/v1/categories/72225088-0eb9-4139-9642-5f9a944dd8de/relationships/ancestors", "related": "https://data.g2.com/api/v1/categories/72225088-0eb9-4139-9642-5f9a944dd8de/ancestors" } }, "descendants": { "links": { "self": "https://data.g2.com/api/v1/categories/72225088-0eb9-4139-9642-5f9a944dd8de/relationships/descendants", "related": "https://data.g2.com/api/v1/categories/72225088-0eb9-4139-9642-5f9a944dd8de/descendants" } }, "parent": { "links": { "self": "https://data.g2.com/api/v1/categories/72225088-0eb9-4139-9642-5f9a944dd8de/relationships/parent", "related": "https://data.g2.com/api/v1/categories/72225088-0eb9-4139-9642-5f9a944dd8de/parent" } } } } }

Parameters

slug URL slug of the category
name Name of the category

Response Fields

name Name of the Category
slug URL slug of the category. e.g. https://www.g2.com/categories/:slug
description Short blurb explaining what products fit in this category.

Products

G2 Products are read-only models. All Reviews and Answers belong to a specific G2 Product, this is most likely one of the core objects that you will be interacting with in the API.

List

Endpoint

GET /api/v1/products

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Product.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/products
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "5d5fc009-c098-4654-afaa-e1c9010516b8", "type": "products", "links": { "self": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8" }, "attributes": { "product_type": "Software", "name": "test product 20", "short_name": "test product 20", "domain": "example.com", "slug": "test-product-20", "description": "Description of product", "detail_description": "Vendor inputted description of product", "image_url": null, "product_url": null, "review_count": 0, "star_rating": 2.5, "avg_rating": "5.0", "public_detail_url": "https://www.g2.com/products/test-product-20/reviews", "updated_at": "2020-10-29T14:00:34.484-05:00", "created_at": "2020-10-29T14:00:34.371-05:00" }, "relationships": { "categories": { "links": { "self": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/relationships/categories", "related": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/categories" } }, "survey_responses": { "links": { "self": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/relationships/survey-responses", "related": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/survey-responses" } }, "competitors": { "links": { "self": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/relationships/competitors", "related": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/competitors" } }, "main_category": { "links": { "self": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/relationships/main-category", "related": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/main-category" } }, "vendor": { "links": { "self": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/relationships/vendor", "related": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/vendor" } }, "product_rating": { "links": { "self": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/relationships/product-rating", "related": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/product-rating" } }, "product_features": { "links": { "self": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/relationships/product-features", "related": "https://data.g2.com/api/v1/products/5d5fc009-c098-4654-afaa-e1c9010516b8/product-features" } } } } ], "meta": { "record_count": 1, "page_count": 1 }, "links": { "first": "https://data.g2.com/api/v1/products?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2.com/api/v1/products?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

Parameters

filter[name] Filter products by name
filter[domain] Filter products by domain name
filter[slug] Filter products by unique URL slug

Response Fields

product_type Type of product. i.e. Software, Provider, Hardware
name Name of the product
short_name Name or shortened name of the product
domain Domain of product's website
slug URL slug of the product. e.g. https://www.g2.com/product/:slug/reviews
description Internal description of product
detail_description Seller-input description of product
image_url URL of product's logo
product_url URL of product's about page
review_count Total number of published reviews on G2
star_rating Average rating between 0-5
avg_rating Average rating between 0-10
public_detail_url Link to product's reviews page on G2
languages_supported Languages this product supports

List Reviews for Product

Endpoint

GET /api/v1/products/:id/survey-responses

    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/products/01faa5b3-7c8a-45ff-a0f3-3cd1bce9332a/survey-responses
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "563", "type": "survey_responses", "links": { "self": "https://data.g2.com/api/v1/survey-responses/563" }, "attributes": { "default_sort": 0.0, "product_name": "test product 9", "is_public": true, "slug": "test-product-9-review-563", "percent_complete": null, "star_rating": 0.0, "title": null, "comment_answers": { }, "secondary_answers": { }, "verified_current_user": false, "is_business_partner": false, "review_source": "Organic", "votes_up": 0, "votes_down": 0, "votes_total": 0, "user_id": "eacc59c3-49e9-4e11-bc8c-62d3f1b18c1a", "user_name": "alex smith", "user_image_url": null, "country_name": null, "regions": null, "submitted_at": "2020-10-29T14:00:28.988-05:00", "updated_at": "2020-10-29T14:00:28.951-05:00", "moderated_at": null, "product_id": "01faa5b3-7c8a-45ff-a0f3-3cd1bce9332a", "reference_user_consent": "unanswered" }, "relationships": { "product": { "links": { "self": "https://data.g2.com/api/v1/survey-responses/563/relationships/product", "related": "https://data.g2.com/api/v1/survey-responses/563/product" } }, "questions": { "links": { "self": "https://data.g2.com/api/v1/survey-responses/563/relationships/questions", "related": "https://data.g2.com/api/v1/survey-responses/563/questions" } }, "answers": { "links": { "self": "https://data.g2.com/api/v1/survey-responses/563/relationships/answers", "related": "https://data.g2.com/api/v1/survey-responses/563/answers" } } } } ], "meta": { "record_count": 1, "page_count": 1 }, "links": { "first": "https://data.g2.com/api/v1/products/01faa5b3-7c8a-45ff-a0f3-3cd1bce9332a/survey-responses?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2.com/api/v1/products/01faa5b3-7c8a-45ff-a0f3-3cd1bce9332a/survey-responses?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

Parameters

filter[name] Filter products by name
filter[domain] Filter products by domain name
filter[slug] Filter products by unique URL slug
page[size] Pagination size
page[number] Pagination page

Response Fields

product_type Type of product. i.e. Software, Provider, Hardware
name Name of the product
short_name Name or shortened name of the product
domain Domain of product's website
slug URL slug of the product. e.g. https://www.g2.com/product/:slug/reviews
description Internal description of product
detail_description Seller-input description of product
image_url URL of product's logo
product_url URL of product's about page
review_count Total number of published reviews on G2
star_rating Average rating between 0-5
avg_rating Average rating between 0-10
public_detail_url Link to product's reviews page on G2
languages_supported Languages this product supports

Show

Endpoint

GET /api/v1/products/:id

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Product.find(id: 'id')
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": { "id": "de102fd9-36ed-469b-b7f0-d9832066c6b4", "type": "products", "links": { "self": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4" }, "attributes": { "product_type": "Software", "name": "test product 25", "short_name": "test product 25", "domain": "example.com", "slug": "test-product-25", "description": "Description of product", "detail_description": "Vendor inputted description of product", "image_url": null, "product_url": null, "review_count": 0, "star_rating": 2.5, "avg_rating": "5.0", "public_detail_url": "https://www.g2.com/products/test-product-25/reviews", "updated_at": "2020-10-29T14:00:36.175-05:00", "created_at": "2020-10-29T14:00:36.059-05:00" }, "relationships": { "categories": { "links": { "self": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/relationships/categories", "related": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/categories" } }, "survey_responses": { "links": { "self": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/relationships/survey-responses", "related": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/survey-responses" } }, "competitors": { "links": { "self": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/relationships/competitors", "related": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/competitors" } }, "main_category": { "links": { "self": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/relationships/main-category", "related": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/main-category" } }, "vendor": { "links": { "self": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/relationships/vendor", "related": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/vendor" } }, "product_rating": { "links": { "self": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/relationships/product-rating", "related": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/product-rating" } }, "product_features": { "links": { "self": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/relationships/product-features", "related": "https://data.g2.com/api/v1/products/de102fd9-36ed-469b-b7f0-d9832066c6b4/product-features" } } } } }

Parameters

filter[name] Filter products by name
filter[domain] Filter products by domain name
filter[slug] Filter products by unique URL slug

Response Fields

product_type Type of product. i.e. Software, Provider, Hardware
name Name of the product
short_name Name or shortened name of the product
domain Domain of product's website
slug URL slug of the product. e.g. https://www.g2.com/product/:slug/reviews
description Internal description of product
detail_description Seller-input description of product
image_url URL of product's logo
product_url URL of product's about page
review_count Total number of published reviews on G2
star_rating Average rating between 0-5
avg_rating Average rating between 0-10
public_detail_url Link to product's reviews page on G2
languages_supported Languages this product supports

Questions

G2 Questions are read-only models. Most API users won’t need to access questions, but they are helpful if you are attempting to build up a review form using our form schema.

List

Endpoint

GET /api/v1/questions

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Question.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/questions
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "1146", "type": "questions", "links": { "self": "https://data.g2.com/api/v1/questions/1146" }, "attributes": { "title": "Industry", "text_template": "What is your industry when using this product?", "is_required": null, "description": null, "question_type": "industry", "input_type": "dropdown" }, "relationships": { "survey_responses": { "links": { "self": "https://data.g2.com/api/v1/questions/1146/relationships/survey-responses", "related": "https://data.g2.com/api/v1/questions/1146/survey-responses" } }, "answers": { "links": { "self": "https://data.g2.com/api/v1/questions/1146/relationships/answers", "related": "https://data.g2.com/api/v1/questions/1146/answers" } } } }, { "id": "1147", "type": "questions", "links": { "self": "https://data.g2.com/api/v1/questions/1147" }, "attributes": { "title": "Company Size", "text_template": "What is your company size when using this product?", "is_required": true, "description": null, "question_type": "company_size", "input_type": "dropdown" }, "relationships": { "survey_responses": { "links": { "self": "https://data.g2.com/api/v1/questions/1147/relationships/survey-responses", "related": "https://data.g2.com/api/v1/questions/1147/survey-responses" } }, "answers": { "links": { "self": "https://data.g2.com/api/v1/questions/1147/relationships/answers", "related": "https://data.g2.com/api/v1/questions/1147/answers" } } } }, { "id": "1148", "type": "questions", "links": { "self": "https://data.g2.com/api/v1/questions/1148" }, "attributes": { "title": "Product Direction", "text_template": "simplistic", "is_required": null, "description": null, "question_type": "direction", "input_type": "dropdown" }, "relationships": { "survey_responses": { "links": { "self": "https://data.g2.com/api/v1/questions/1148/relationships/survey-responses", "related": "https://data.g2.com/api/v1/questions/1148/survey-responses" } }, "answers": { "links": { "self": "https://data.g2.com/api/v1/questions/1148/relationships/answers", "related": "https://data.g2.com/api/v1/questions/1148/answers" } } } } ], "meta": { "record_count": 3, "page_count": 1 }, "links": { "first": "https://data.g2.com/api/v1/questions?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2.com/api/v1/questions?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

Parameters

filter[question_type] Internal name for the question
page[size] Pagination size (default: 10, max: 100)
page[number] Pagination page
filter[updated_at_gt] Min time for when a record was last updated. Using rfc3339 format.
filter[updated_at_lt] Max time for when a record was last updated. Using rfc3339 format.

Response Fields

title Internal name of the question.
text_template Text value of the question
is_required True/False whether this question is required to be answered by the reviewer
description The actual question of the question model
question_type Internal name for the question.
input_type How the question should be displayed, can only be one of the following categories, comment, company_domain, dropdown, editions, employment_position, feature, product_search, simple_7, slider_nps, product_integration, product_provider, text_field, upload
data Returns the results as an array
links This contains the links for remaining result pages with the same parameters. Returned as self, prev, first, next, and last. next and prev may be blank if you are on the first or last page respectively.

Show

Endpoint

GET /api/v1/questions/:id

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Question.find(id: 'id')
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/questions/1143
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": { "id": "1143", "type": "questions", "links": { "self": "https://data.g2.com/api/v1/questions/1143" }, "attributes": { "title": "Industry", "text_template": "What is your industry when using this product?", "is_required": null, "description": null, "question_type": "industry", "input_type": "dropdown" }, "relationships": { "survey_responses": { "links": { "self": "https://data.g2.com/api/v1/questions/1143/relationships/survey-responses", "related": "https://data.g2.com/api/v1/questions/1143/survey-responses" } }, "answers": { "links": { "self": "https://data.g2.com/api/v1/questions/1143/relationships/answers", "related": "https://data.g2.com/api/v1/questions/1143/answers" } } } } }

Parameters

filter[question_type] Internal name for the question

Response Fields

title Internal name of the question.
text_template Text value of the question
is_required True/False whether this question is required to be answered by the reviewer
description The actual question of the question model
question_type Internal name for the question.
input_type How the question should be displayed, can only be one of the following categories, comment, company_domain, dropdown, editions, employment_position, feature, product_search, simple_7, slider_nps, product_integration, product_provider, text_field, upload

RESThooks

This is an implementation of the RESThooks pattern, that you can read about at resthooks.org. You can subscribe a webhook endpoint to be notified of specific events within G2. A JSON message will be delivered to the endpoint that you provide, describing the event and including relevant attributes.

List

Endpoint

GET /api/v1/resource-subscriptions

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::RESThook.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/resource-subscriptions
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "104", "type": "resource_subscriptions", "links": { "self": "https://data.g2.com/api/v1/resource-subscriptions/104" }, "attributes": { "post_url": "http://www.example.com", "subscribed_resource": "leads", "updated_at": "2020-10-29T14:01:01.543-05:00", "product_uuid": "05e0b69c-30a3-4ad5-b71a-c05f451513fa", "product_id": 1619 } } ], "meta": { "record_count": 1, "page_count": 1 }, "links": { "first": "https://data.g2.com/api/v1/resource-subscriptions?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2.com/api/v1/resource-subscriptions?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

Parameters

page[size] Pagination size (default: 10, max: 100)
page[number] Pagination page
filter[updated_at_gt] Min time for when a record was last updated. Using rfc3339 format.
filter[updated_at_lt] Max time for when a record was last updated. Using rfc3339 format.

Response Fields

post_url URL where we should post the RESThook event
subscribed_resource The type of event we should post to the post_url
product_uuid UUID of the product to which you are subscribed
product_id ID of the product to which you are subscribed
data Returns the results as an array
links This contains the links for remaining result pages with the same parameters. Returned as self, prev, first, next, and last. next and prev may be blank if you are on the first or last page respectively.

Show

Endpoint

GET /api/v1/resource-subscriptions/:id

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::RESThook.find(id: 'id')
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/resource-subscriptions/102
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": { "id": "102", "type": "resource_subscriptions", "links": { "self": "https://data.g2.com/api/v1/resource-subscriptions/102" }, "attributes": { "post_url": "http://www.example.com", "subscribed_resource": "leads", "updated_at": "2020-10-29T14:01:00.376-05:00", "product_uuid": "f166fb6b-7161-4089-a8c9-6a3f674e2896", "product_id": 1617 } } }

Response Fields

post_url URL where we should post the RESThook event
subscribed_resource The type of event we should post to the post_url
product_uuid UUID of the product to which you are subscribed
product_id ID of the product to which you are subscribed

Subscribe

Endpoint

POST /api/v1/resource-subscriptions

    

Curl Request

curl -g -X POST -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/resource-subscriptions -d {"data":{"type":"resource_subscriptions","attributes":{"subscribed_resource":"leads","post_url":"http://requestb.in"}}}
      

Request

POST /api/v1/resource-subscriptions HTTP/1.1 Authorization: Token token=secret Content-Type: application/vnd.api+json { "data": { "type": "resource_subscriptions", "attributes": { "subscribed_resource": "leads", "post_url": "http://requestb.in" } } }
    

Response

Simulated Response HTTP/1.1 201 Created Content-Type: application/vnd.api+json { "data": { "id": "107", "type": "resource_subscriptions", "links": { "self": "https://data.g2.com/api/v1/resource-subscriptions/107" }, "attributes": { "post_url": "http://requestb.in", "subscribed_resource": "leads", "updated_at": "2020-10-29T14:01:02.977-05:00", "product_uuid": "4ed7a80a-5a05-4993-aedf-22fb07ff5aa7", "product_id": 1621 } } }

Parameters

data[type] required JSONAPI requires this value to be `resource_subscriptions`
data[attributes][subscribed_resource] required One of `leads`, `survey_responses`, or `attribution_tracking/remote_conversion`
data[attributes][post_url] Webhook target. When a new resource is created, we will emit a webhook to this URL

Response Fields

post_url URL where we should post the RESThook event
subscribed_resource The type of event we should post to the post_url
product_uuid UUID of the product to which you are subscribed
product_id ID of the product to which you are subscribed

Un-subscribe

Endpoint

DELETE /api/v1/resource-subscriptions/:id

    

Curl Request

curl -g -X DELETE -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/resource-subscriptions/105
    

Response

Simulated Response HTTP/1.1 204 No Content

Response Fields

post_url URL where we should post the RESThook event
subscribed_resource The type of event we should post to the post_url
product_uuid UUID of the product to which you are subscribed
product_id ID of the product to which you are subscribed

Reviews

A G2 Review is a denormalized object built from a series of Questions and Answers written by a G2 User, about a G2 Product.

List

Endpoint

GET /api/v1/survey-responses

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Review.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/survey-responses
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "585", "type": "survey_responses", "links": { "self": "https://data.g2.com/api/v1/survey-responses/585" }, "attributes": { "default_sort": 0.0, "product_name": "test product 36", "is_public": true, "slug": "test-product-36-review-585", "percent_complete": null, "star_rating": 2.5, "title": "Review title", "comment_answers": { "love": { "text": "What do you like best?", "value": "I like..." }, "hate": { "text": "What do you dislike?", "value": "I dislike..." } }, "secondary_answers": { }, "verified_current_user": false, "is_business_partner": false, "review_source": "Organic", "votes_up": 0, "votes_down": 0, "votes_total": 0, "user_id": "49223854-021c-4559-b515-7ba30971b5b1", "user_name": "alex smith", "user_image_url": null, "country_name": "United States", "regions": [ "North America" ], "submitted_at": "2020-10-29T14:00:53.162-05:00", "updated_at": "2020-10-29T14:00:53.126-05:00", "moderated_at": null, "product_id": "60db3b06-c54a-45b5-a7ec-7b5943eb519e", "reference_user_consent": "unanswered" }, "relationships": { "product": { "links": { "self": "https://data.g2.com/api/v1/survey-responses/585/relationships/product", "related": "https://data.g2.com/api/v1/survey-responses/585/product" } }, "questions": { "links": { "self": "https://data.g2.com/api/v1/survey-responses/585/relationships/questions", "related": "https://data.g2.com/api/v1/survey-responses/585/questions" } }, "answers": { "links": { "self": "https://data.g2.com/api/v1/survey-responses/585/relationships/answers", "related": "https://data.g2.com/api/v1/survey-responses/585/answers" } } } } ], "meta": { "record_count": 1, "page_count": 1 }, "links": { "first": "https://data.g2.com/api/v1/survey-responses?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2.com/api/v1/survey-responses?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

Parameters

filter[submitted_at_gt] Min time for when a review was completed. Using rfc3339 format.
filter[submitted_at_lt] Max time for when a review was completed. Using rfc3339 format.
filter[moderated_at_gt] Min time for when a review was published. Using rfc3339 format.
filter[moderated_at_lt] Max time for when a review was published. Using rfc3339 format.
page[size] Pagination size (default: 10, max: 100)
page[number] Pagination page
filter[updated_at_gt] Min time for when a record was last updated. Using rfc3339 format.
filter[updated_at_lt] Max time for when a record was last updated. Using rfc3339 format.

Response Fields

default_sort
product_name Name of the product
is_public True/False whether the reviewer permitted the review to be attributed to them
slug URL slug of the review. e.g. https://www.g2.com/products/:product_slug/reviews/:review_slug
percent_complete The percentage complete all Review Questions are
star_rating Rating between 0-5
title Title of the Review
comment_answers Primary review question answers
secondary_answers Secondary review question answers
verified_current_user True/False whether the reviewer is verified
is_business_partner True/False whether the reviewer has a business relationship with the product
review_source Was the review organic or incentivised
votes_up Total votes indicating the review was helpful
votes_down Total votes indicating the review was not helpful
votes_total Total votes on the review
user_id Internal UUID of the Reviewer
user_name Name of the Reviewer
country_name Reviewer's country
regions Reviewer's geographical region(s)
user_image_url URL of reviewer's avatar
submitted_at Date review was submitted
updated_at Date review was last edited
moderated_at Date review was moderated
product_id UUID of the product the review was referencing
reference_user_consent Has the Reviewer provided permission to use this review content
data Returns the results as an array
links This contains the links for remaining result pages with the same parameters. Returned as self, prev, first, next, and last. next and prev may be blank if you are on the first or last page respectively.

Show

Endpoint

GET /api/v1/survey-responses/:id

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Review.find(id: 'id')
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/survey-responses/582
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": { "id": "582", "type": "survey_responses", "links": { "self": "https://data.g2.com/api/v1/survey-responses/582" }, "attributes": { "default_sort": 0.0, "product_name": "test product 34", "is_public": true, "slug": "test-product-34-review-582", "percent_complete": null, "star_rating": 2.5, "title": "Review title", "comment_answers": { "love": { "text": "What do you like best?", "value": "I like..." }, "hate": { "text": "What do you dislike?", "value": "I dislike..." } }, "secondary_answers": { }, "verified_current_user": false, "is_business_partner": false, "review_source": "Organic", "votes_up": 0, "votes_down": 0, "votes_total": 0, "user_id": "393196fd-dd68-46d7-a7c8-b7821e08c79c", "user_name": "alex smith", "user_image_url": null, "country_name": "United States", "regions": [ "North America" ], "submitted_at": "2020-10-29T14:00:51.424-05:00", "updated_at": "2020-10-29T14:00:51.371-05:00", "moderated_at": null, "product_id": "9f371677-a1f7-4198-b6b2-cf0ebab188cf", "reference_user_consent": "unanswered" }, "relationships": { "product": { "links": { "self": "https://data.g2.com/api/v1/survey-responses/582/relationships/product", "related": "https://data.g2.com/api/v1/survey-responses/582/product" } }, "questions": { "links": { "self": "https://data.g2.com/api/v1/survey-responses/582/relationships/questions", "related": "https://data.g2.com/api/v1/survey-responses/582/questions" } }, "answers": { "links": { "self": "https://data.g2.com/api/v1/survey-responses/582/relationships/answers", "related": "https://data.g2.com/api/v1/survey-responses/582/answers" } } } } }

Parameters

filter[submitted_at_gt] Min time for when a review was completed. Using rfc3339 format.
filter[submitted_at_lt] Max time for when a review was completed. Using rfc3339 format.
filter[moderated_at_gt] Min time for when a review was published. Using rfc3339 format.
filter[moderated_at_lt] Max time for when a review was published. Using rfc3339 format.

Response Fields

default_sort
product_name Name of the product
is_public True/False whether the reviewer permitted the review to be attributed to them
slug URL slug of the review. e.g. https://www.g2.com/products/:product_slug/reviews/:review_slug
percent_complete The percentage complete all Review Questions are
star_rating Rating between 0-5
title Title of the Review
comment_answers Primary review question answers
secondary_answers Secondary review question answers
verified_current_user True/False whether the reviewer is verified
is_business_partner True/False whether the reviewer has a business relationship with the product
review_source Was the review organic or incentivised
votes_up Total votes indicating the review was helpful
votes_down Total votes indicating the review was not helpful
votes_total Total votes on the review
user_id Internal UUID of the Reviewer
user_name Name of the Reviewer
country_name Reviewer's country
regions Reviewer's geographical region(s)
user_image_url URL of reviewer's avatar
submitted_at Date review was submitted
updated_at Date review was last edited
moderated_at Date review was moderated
product_id UUID of the product the review was referencing
reference_user_consent Has the Reviewer provided permission to use this review content

Syndication::AnswerDistributions

Show

Endpoint

GET /api/2018-01-01/syndication/questions/:question_id/answer-distributions/:id

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Syndication::AnswerDistribution.find(id: 'id')
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/questions/724/answer-distributions/fec90683-7524-4144-8114-3f8426f12762?category_id=6540bc71-ccb9-4738-8008-6b50bcea36e9
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": { "id": "fec90683-7524-4144-8114-3f8426f12762", "type": "review_aggregates-answer_distributions", "attributes": { "z_score": -0.7071067811865475, "percentile": 23, "review_count": 30, "product_count": 2, "question": { "id": 724, "title": "NPS Question", "question_type": "nps", "description": null, "text": "How likely is it that you would recommend Product One to a friend or colleague?" }, "product": { "name": "Product One", "domain": "example.com", "slug": "product-one", "product_type": "Software", "star_rating": 2.5, "avg_rating": "5.0", "detail_description": "Description", "review_count": 0, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://www.g2.com/products/product-one/reviews", "write_review_url": "https://www.g2.com/products/product-one/take_survey" }, "category": { "6540bc71-ccb9-4738-8008-6b50bcea36e9": { "name": "test", "slug": "test", "description": "test", "product_count": 0 } } } } }

Parameters

id The UUID of the reviewed product
category_id The UUID of the review category
question_id The ID of the question being answered

Response Fields

data[attributes][id] Returns the product ID
data[attributes][attributes] Returns statistical data about answer distributions, as well as data about the product and question

Syndication::Competitors

Show

Endpoint

GET /api/2018-01-01/syndication/products/:product_id/competitors

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Syndication::Competitor.find(id: 'id')
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/products/1254c51c-b62e-490a-85d3-115445fd5ddc/competitors
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": [ { "id": "e9087b06-15ab-4335-934a-b7a0ea089e73", "type": "softwares", "attributes": { "product": { "name": "test product 40", "domain": "example.com", "slug": "test-product-40", "product_type": "Software", "star_rating": 2.5, "avg_rating": "5.0", "detail_description": null, "review_count": 0, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://www.g2.com/products/test-product-40/reviews", "write_review_url": "https://www.g2.com/products/test-product-40/take_survey" }, "main_category": { "2749da74-29a5-47b4-b820-e2e12f6e78eb": { "name": "test", "slug": "test", "description": "test", "product_count": 0 } }, "categories": { "2749da74-29a5-47b4-b820-e2e12f6e78eb": { "name": "test", "slug": "test", "description": "test", "product_count": 0 } }, "relationships": { "product_ratings": { "links": { "self": "https://data.g2.com/api/syndication/products/e9087b06-15ab-4335-934a-b7a0ea089e73/product_ratings" } } } } } ] }

Parameters

product_id The UUID of the product
per Number of competitors to list

Response Fields

data Returns the competitor products as an array

Syndication::EmbeddedReviews

EmbeddedReviews allow you to render and submit a G2 review form on your website.

Review Form

The Review Form endpoint returns all the data required to render a G2 review form.

Endpoint

POST /api/2018-01-01/syndication/embedded_reviews/review_form

    

Curl Request

curl -g -X POST -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/embedded_reviews/review_form -d {"format":"json","product_id":"f535b1a8-91a7-4736-91b0-587fcfc8c4d5","user":{"email":"example@example.com"}}
      

Request

POST /api/2018-01-01/syndication/embedded_reviews/review_form HTTP/1.1 Authorization: Token token=secret Content-Type: application/vnd.api+json { "format": "json", "product_id": "f535b1a8-91a7-4736-91b0-587fcfc8c4d5", "user": { "email": "example@example.com" } }
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": { "type": "review_form", "attributes": { "product_id": "f535b1a8-91a7-4736-91b0-587fcfc8c4d5", "terms_accepted": { "checked": false, "links": { "terms_of_use": "https://www.g2.com/pages/terms", "privacy_policy": "https://www.g2.com/pages/privacy" } }, "review_status": "started", "relationships": { "questions": { "data": [ { "id": 882, "type": "question", "name": "What is your company size when using this product?", "input_type": "select", "required_answer_type": "option_id", "validations": { "required": true, "min_character_count": null }, "options": [ { "text": "Myself Only", "rank": 0, "option_id": 306 }, { "text": "2-10 employees", "rank": 1, "option_id": 307 }, { "text": "11-50 employees", "rank": 2, "option_id": 308 }, { "text": "51-200 employees", "rank": 3, "option_id": 309 }, { "text": "201-500 employees", "rank": 4, "option_id": 310 }, { "text": "501-1000 employees", "rank": 5, "option_id": 311 }, { "text": "1001-5000 employees", "rank": 6, "option_id": 312 }, { "text": "5001-10,000 employees", "rank": 7, "option_id": 313 }, { "text": "10,001+ employees", "rank": 8, "option_id": 314 } ], "answer": { "option_id": null } }, { "id": "withhold_name", "type": "question", "name": "I would like this review to appear as Unattributed. Do not show my name and picture to the G2 community.", "input_type": "checkbox", "required_answer_type": "boolean", "validations": { "required": true, "min_character_count": null }, "options": [ ], "answer": { "boolean": false } }, { "id": "title", "type": "question", "name": "Title", "input_type": "short_text", "required_answer_type": "text", "validations": { "required": true, "min_character_count": null }, "options": [ ], "answer": { "text": null } }, { "id": "company", "type": "question", "name": "Company", "input_type": "short_text", "required_answer_type": "text", "validations": { "required": true, "min_character_count": null }, "options": [ ], "answer": { "text": null } } ] } } } } }

Parameters

product_id required The UUID of the product being reviewed.
user[email] required Email of user writing the review

Response Fields

data Returns data needed to render a G2 review form

Submit

The Create endpoint allows you to submit a G2 review. All parameters should be nested under review_form[attributes]

Endpoint

POST /api/2018-01-01/syndication/embedded_reviews

    

Curl Request

curl -g -X POST -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/embedded_reviews -d {"format":"json","review_form":{"attributes":{"product_id":"81cf23d9-252a-4325-bc28-c831e19f76f7","user":{"email":"alexsmith@gmail.com","first_name":"Alex","last_name":"Smith"},"terms_accepted":"true","relationships":{"answers":{"0":{"attributes":{"question_id":"4","text":"title"}},"1":{"attributes":{"question_id":"9","text":"solving a lot of things"}},"2":{"attributes":{"question_id":"8","text":"great would recommend great product would recommend"}},"3":{"attributes":{"question_id":"264","option_ids":["179","309"]}},"4":{"attributes":{"question_id":"title","text":"Manager"}},"5":{"attributes":{"question_id":"company","text":"G2"}},"6":{"attributes":{"question_id":"withhold_name","boolean":"true"}},"7":{"attributes":{"question_id":"881","option_id":"297"}}}}}}}
      

Request

POST /api/2018-01-01/syndication/embedded_reviews HTTP/1.1 Authorization: Token token=secret Content-Type: application/vnd.api+json { "format": "json", "review_form": { "attributes": { "product_id": "81cf23d9-252a-4325-bc28-c831e19f76f7", "user": { "email": "alexsmith@gmail.com", "first_name": "Alex", "last_name": "Smith" }, "terms_accepted": "true", "relationships": { "answers": { "0": { "attributes": { "question_id": "4", "text": "title" } }, "1": { "attributes": { "question_id": "9", "text": "solving a lot of things" } }, "2": { "attributes": { "question_id": "8", "text": "great would recommend great product would recommend" } }, "3": { "attributes": { "question_id": "264", "option_ids": [ "179", "309" ] } }, "4": { "attributes": { "question_id": "title", "text": "Manager" } }, "5": { "attributes": { "question_id": "company", "text": "G2" } }, "6": { "attributes": { "question_id": "withhold_name", "boolean": "true" } }, "7": { "attributes": { "question_id": "881", "option_id": "297" } } } } } } }
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "status": "success" }

Parameters

product_id required The UUID of the product being reviewed.
user required The email, first_name, and last_name of the user writing the review. (See example request for formatting)
terms_accepted required Whether the user accepted G2's terms and conditions (true or false)
relationships[answers] required A numbered list of answers to the questions asked in the review (See example request for formatting)

Response Fields

status Success

Syndication::IntegrationReviews

List

Endpoint

GET /api/2018-01-01/syndication/integration_reviews

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Syndication::IntegrationReview.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/integration_reviews?filter[product_id]=cac5ace2-18a0-4688-85a1-4827c18c4024&filter[primary_product_id]=a77f2299-c364-40b1-a3e9-28991974b81c
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": [ { "id": "37", "type": "integration_reviews", "attributes": { "product_name": "Product One", "primary_product_name": "Product Two", "submitted_at": "2020-10-22T14:00:57.820-05:00", "published_at": "2020-10-29T14:00:57.374-05:00", "answers": { "benefits": { "text": "What business problem are you solving with Product One's integration with Product Two? What benefits have you realized?", "value": "The benefits of integrating with Product Two are..." } }, "star_rating": 4.5, "user": { "industry": "Consumer Goods", "company_segment": null, "name": "alex s.", "image": null, "title": null, "company": "ACME" }, "review": { "id": 587, "title": "Review Title", "g2crowd_url": "https://www.g2.com/survey_responses/product-one-review-587", "review_incentive": false, "verified_current_user": true } } } ], "links": { "self": "https://data.g2.com/api/2018-01-01/syndication/integration_reviews?filter%5Bprimary_product_id%5D=a77f2299-c364-40b1-a3e9-28991974b81c&filter%5Bproduct_id%5D=cac5ace2-18a0-4688-85a1-4827c18c4024&page%5Bnumber%5D=1&page%5Bsize%5D=10", "first": "https://data.g2.com/api/2018-01-01/syndication/integration_reviews?filter%5Bprimary_product_id%5D=a77f2299-c364-40b1-a3e9-28991974b81c&filter%5Bproduct_id%5D=cac5ace2-18a0-4688-85a1-4827c18c4024&page%5Bnumber%5D=1&page%5Bsize%5D=10", "prev": null, "next": null, "last": "https://data.g2.com/api/2018-01-01/syndication/integration_reviews?filter%5Bprimary_product_id%5D=a77f2299-c364-40b1-a3e9-28991974b81c&filter%5Bproduct_id%5D=cac5ace2-18a0-4688-85a1-4827c18c4024&page%5Bnumber%5D=1&page%5Bsize%5D=10" }, "meta": { "aggregates": [ { "filter_name": "nps_score", "collection": [ { "id": 5, "text": "5 star", "count": 1, "checked": false, "nested_boxes": [ ] }, { "id": 4, "text": "4 star", "count": 0, "checked": false, "nested_boxes": [ ] }, { "id": 3, "text": "3 star", "count": 0, "checked": false, "nested_boxes": [ ] }, { "id": 2, "text": "2 star", "count": 0, "checked": false, "nested_boxes": [ ] }, { "id": 1, "text": "1 star", "count": 0, "checked": false, "nested_boxes": [ ] } ], "expanded": true } ], "record_count": 1, "page_count": 1, "product": { "name": "Product One", "domain": "example.com", "slug": "product-one", "product_type": "Software", "star_rating": 2.5, "avg_rating": "5.0", "detail_description": null, "review_count": 0, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://www.g2.com/products/product-one/reviews", "write_review_url": "https://www.g2.com/products/product-one/take_survey" } } }

Parameters

filter[product_id] required The UUID of the product the integration reviews belong to
filter[primary_product_id] required The UUID of the primary product the product integrates with
page[size] Pagination size (default: 10, max: 100)
page[number] Pagination page (default: 1)
filter[nps_score][] Valid Options: [1, 2, 3, 4, 5]
filter[company_segment][] Valid options are returned under aggregates

Response Fields

data Returns the integration reviews as an array
links This contains the links for remaining result pages with the same parameters. Returned as self, prev, first, next, and last. next and prev may be blank if there you are on the first or last page respectively.
meta[aggregates] This contains the data necessary for building filters. [ { filter_name: the parameter name of the filter to apply i.e. filter[FILTER_NAME][]=, collection: [ { "id": The id used for filtering i.e. filter[FILTER_NAME][]=ID Multiple values are permitted i.e. filter[FILTER_NAME][]=ID&filter[FILTER_NAME][]=ID2, "text": Human readable name of the filter option, "count": # of review that match this filter, "checked": True if the results are currently filtered by this option } ] } ]
meta[record_count] Number of total reviews available
meta[page_count] Number of total pages of reviews available
meta[product] Details of the product the integration reviews belong to

Syndication::ProductRatings

Show

Endpoint

GET /api/2018-01-01/syndication/products/:product_id/product_ratings

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Syndication::ProductRating.find(id: 'id')
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/products/b9997172-5e09-42df-82d9-68e672641f19/product_ratings
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "ease_of_use": 0, "quality_of_support": 1.7, "ease_of_setup": 5.0 }

Parameters

product_id The UUID of the reviewed product

Response Fields

ease_of_use Returns the average ease of use rating from 0-10
quality_of_support Returns the average quality of support rating from 0-10
ease_of_setup Returns the average ease of setup rating from 0-10

Syndication::Products

List

Endpoint

GET /api/2018-01-01/syndication/products?filter[product_id][]=:product_id&filter[product_id][]=:product2_id&vendor=true

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Syndication::Product.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/products?filter[product_id][]=2c474219-bf33-464b-808a-d2942082d9c3&filter[product_id][]=da5a721e-113e-4ca7-86d8-f25bab1ee345&vendor=true
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": [ { "id": "2c474219-bf33-464b-808a-d2942082d9c3", "type": "softwares", "attributes": { "product": { "name": "Product One", "domain": "example.com", "slug": "product-one", "product_type": "Software", "star_rating": 2.5, "avg_rating": "5.0", "detail_description": "Description", "review_count": 0, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://www.g2.com/products/product-one/reviews", "write_review_url": "https://www.g2.com/products/product-one/take_survey" }, "main_category": { "2813d9a4-2415-486d-a2d7-affbd79e0025": { "name": "Example Category", "slug": "example-category", "description": "Example Category is...", "product_count": 1 } }, "categories": { "9a54a6ec-713d-4f2e-a8d7-26e8e1ed4102": { "name": "test", "slug": "test", "description": "test", "product_count": 0 }, "2813d9a4-2415-486d-a2d7-affbd79e0025": { "name": "Example Category", "slug": "example-category", "description": "Example Category is...", "product_count": 1 } }, "vendor": { "id": "a289444e-f2a2-48a0-8729-5ed0843a7cb2", "name": "Test Vendor", "slug": "test-vendor" }, "relationships": { "product_ratings": { "links": { "self": "https://data.g2.com/api/syndication/products/2c474219-bf33-464b-808a-d2942082d9c3/product_ratings" } } } } }, { "id": "da5a721e-113e-4ca7-86d8-f25bab1ee345", "type": "softwares", "attributes": { "product": { "name": "Product Two", "domain": "example.com", "slug": "product-two", "product_type": "Software", "star_rating": 2.5, "avg_rating": "5.0", "detail_description": "Description Two", "review_count": 0, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://www.g2.com/products/product-two/reviews", "write_review_url": "https://www.g2.com/products/product-two/take_survey" }, "main_category": { "d4603493-d3c7-400e-8637-b59d6a60cdaf": { "name": "test", "slug": "test-32b71fd0-d4c0-4bca-804b-021612acd294", "description": "test", "product_count": 0 } }, "categories": { "d4603493-d3c7-400e-8637-b59d6a60cdaf": { "name": "test", "slug": "test-32b71fd0-d4c0-4bca-804b-021612acd294", "description": "test", "product_count": 0 } }, "vendor": { "id": "3f9f9668-2506-412c-94ea-9899fc75aefc", "name": "Test Vendor", "slug": "test-vendor-75f2fc46-5e5a-42d7-bbb1-facdcc2fcee9" }, "relationships": { "product_ratings": { "links": { "self": "https://data.g2.com/api/syndication/products/da5a721e-113e-4ca7-86d8-f25bab1ee345/product_ratings" } } } } } ], "links": { "self": "https://data.g2.com/api/2018-01-01/syndication/products?filter%5Bproduct_id%5D%5B%5D=2c474219-bf33-464b-808a-d2942082d9c3&filter%5Bproduct_id%5D%5B%5D=da5a721e-113e-4ca7-86d8-f25bab1ee345&page%5Bnumber%5D=1&page%5Bsize%5D=10&vendor=true", "first": "https://data.g2.com/api/2018-01-01/syndication/products?filter%5Bproduct_id%5D%5B%5D=2c474219-bf33-464b-808a-d2942082d9c3&filter%5Bproduct_id%5D%5B%5D=da5a721e-113e-4ca7-86d8-f25bab1ee345&page%5Bnumber%5D=1&page%5Bsize%5D=10&vendor=true", "prev": null, "next": null, "last": "https://data.g2.com/api/2018-01-01/syndication/products?filter%5Bproduct_id%5D%5B%5D=2c474219-bf33-464b-808a-d2942082d9c3&filter%5Bproduct_id%5D%5B%5D=da5a721e-113e-4ca7-86d8-f25bab1ee345&page%5Bnumber%5D=1&page%5Bsize%5D=10&vendor=true" }, "meta": { "aggregates": [ { "filter_name": "star_rating", "collection": [ { "id": 0, "text": "Unrated", "count": 0 }, { "id": 1, "text": "1 Star", "count": 0 }, { "id": 2, "text": "2 Star", "count": 0 }, { "id": 3, "text": "3 Star", "count": 2 }, { "id": 4, "text": "4 Star", "count": 0 }, { "id": 5, "text": "5 Star", "count": 0 } ] } ], "record_count": 2, "page_count": 1 } }

Parameters

page[size] Pagination size (default: 10, max: 100)
page[number] Pagination page (default: 1)
filter[star_rating][] Valid Options: [1, 2, 3, 4, 5]
filter[product_id][] Filter products by ID
filter[category_id][] Filter products by category ID
filter[vendor_name] Filter products by name of company
filter[review_count_gteq] Filter products by review count equal to or greater than
filter[slug] Filter products to a specific slug
vendor Show vendor information (default: false)

Response Fields

data Returns the syndicated products as an array
links This contains the links for remaining result pages with the same parameters. Returned as self, prev, first, next, and last. next and prev may be blank if you are on the first or last page respectively.
meta[aggregates] This contains the data necessary for building filters. [ { filter_name: the parameter name of the filter to apply i.e. filter[FILTER_NAME][]=, collection: [ { "id": The id used for filtering i.e. filter[FILTER_NAME][]=ID Multiple values are permitted i.e. filter[FILTER_NAME][]=ID&filter[FILTER_NAME][]=ID2, "text": Human readable name of the filter option, "count": # of review that match this filter, "checked": True if the results are currently filtered by this option } ] } ]
meta[record_count] Number of total products available
meta[page_count] Number of total pages of products available

Show

Endpoint

GET /api/2018-01-01/syndication/products/:id?vendor=true

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Syndication::Product.find(id: 'id')
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/products/d9fb2ed2-6214-4580-9cdd-95a16822e280?vendor=true
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": { "id": "d9fb2ed2-6214-4580-9cdd-95a16822e280", "type": "softwares", "attributes": { "product": { "name": "Product One", "domain": "example.com", "slug": "product-one", "product_type": "Software", "star_rating": 2.5, "avg_rating": "5.0", "detail_description": "Description", "review_count": 0, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://www.g2.com/products/product-one/reviews", "write_review_url": "https://www.g2.com/products/product-one/take_survey" }, "main_category": { "8bed5bbb-8cc1-474e-b8bc-b05f431f0219": { "name": "Example Category", "slug": "example-category", "description": "Example Category is...", "product_count": 1 } }, "categories": { "4c04b614-712b-44cc-8990-c79f6d39da34": { "name": "test", "slug": "test", "description": "test", "product_count": 0 }, "8bed5bbb-8cc1-474e-b8bc-b05f431f0219": { "name": "Example Category", "slug": "example-category", "description": "Example Category is...", "product_count": 1 } }, "vendor": { "id": "1c71bbec-3644-4315-8980-7325ad548743", "name": "Test Vendor", "slug": "test-vendor" }, "relationships": { "product_ratings": { "links": { "self": "https://data.g2.com/api/syndication/products/d9fb2ed2-6214-4580-9cdd-95a16822e280/product_ratings" } } } } } }

Parameters

vendor Show vendor information (default: false)

Syndication::Reviews

List

Endpoint

GET /api/2018-01-01/syndication/reviews

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Syndication::Review.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/reviews?filter[product_id]=5c928251-1cdd-4318-8a67-b7543a0f3f41
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": [ { "id": "70", "type": "survey_responses", "attributes": { "default_sort": 0.0, "is_public": true, "slug": "product-one-review-70", "percent_complete": 84.0, "submitted_at": "2021-01-27T18:31:17.148-06:00", "title": "Review title", "url": "https://www.g2.com/products/product-one/reviews/product-one-review-70", "answers": { "love": { "text": "What do you like best?", "value": "I like..." }, "hate": { "text": "What do you dislike?", "value": "I dislike..." } }, "published_at": "2021-02-16T18:31:17.160-06:00", "regions": [ ], "country_name": null, "product_name": "Product One", "source": "Organic", "review_incentive": false, "star_rating": 2.5, "user": { "industry": null, "name": "alex s.", "image": null, "company": "Test Co.", "title": "CEO at Test Co.", "company_segment": "Small-Business (50 or fewer emp.)" }, "verified_current_user": false, "comment_present": false, "official_response_present": false } } ], "meta": { "aggregates": [ { "filter_name": "nps_score", "collection": [ { "id": 5, "text": "5 star", "count": 0, "checked": false, "nested_boxes": [ ] }, { "id": 4, "text": "4 star", "count": 0, "checked": false, "nested_boxes": [ ] }, { "id": 3, "text": "3 star", "count": 1, "checked": false, "nested_boxes": [ ] }, { "id": 2, "text": "2 star", "count": 0, "checked": false, "nested_boxes": [ ] }, { "id": 1, "text": "1 star", "count": 0, "checked": false, "nested_boxes": [ ] } ], "expanded": true }, { "filter_name": "company_segment", "collection": [ { "id": 50, "text": "Small-Business (50 or fewer emp.)", "count": 1, "checked": false, "nested_boxes": [ ] } ], "expanded": false }, { "filter_name": "all_industry", "collection": [ { "id": 49, "text": "Accounting", "count": 1, "checked": false, "nested_boxes": [ ] } ], "expanded": false }, { "filter_name": "industry", "collection": [ { "id": 49, "text": "Accounting", "count": 1, "checked": false, "nested_boxes": [ ] } ], "expanded": false } ], "record_count": 1, "page_count": 1, "product": { "name": "Product One", "domain": "example.com", "slug": "product-one", "product_type": "Software", "star_rating": 2.5, "avg_rating": "5.0", "detail_description": "Description", "review_count": 0, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://www.g2.com/products/product-one/reviews", "write_review_url": "https://www.g2.com/products/product-one/take_survey" }, "rating": 0.0 } }

Parameters

filter[product_id] required The UUID id of the product the reviews belong to
page[size] Pagination size (default: 10, max: 100)
page[number] Pagination page (default: 1)
filter[nps_score][] Valid Options: [1, 2, 3, 4, 5]
filter[company_segment][] Valid options are returned under aggregates
filter[industry][] Valid options are returned under aggregates
filter[category_ids][] Valid options are returned under aggregates
filter[role][] Valid options are returned under aggregates
filter[regions][]
filter[country_name][]
filter[updated_at_gt] Filters to all reviews updated since the date. (Format: "2019-01-01")
filter[updated_at_lt] Filters to all reviews updated before the date. (Format: "2019-01-01")
filter[comment_answer_values_exclude] Exclude reviews that contain the keywords passed in the filter

Response Fields

data Returns the reviews as an array
links This contains the links for remaining result pages with the same parameters. Returned as self, prev, first, next, and last. next and prev may be blank if you are on the first or last page respectively.
meta[aggregates] This contains the data necessary for building filters. [ { filter_name: the parameter name of the filter to apply i.e. filter[FILTER_NAME][]=, collection: [ { "id": The id used for filtering i.e. filter[FILTER_NAME][]=ID Multiple values are permitted i.e. filter[FILTER_NAME][]=ID&filter[FILTER_NAME][]=ID2, "text": Human readable name of the filter option, "count": # of review that match this filter, "checked": True if the results are currently filtered by this option } ] } ]
meta[record_count] Number of total reviews available
meta[page_count] Number of total pages of reviews available
meta[rating] Average rating of the product
meta[product] Details of the product the reviews belong to

Syndication::Reviews::Comments

Archive

Only comments created through this API can be updated through this API.

Endpoint

DELETE /api/2018-01-01/syndication/reviews/comments/:id

    

Curl Request

curl -g -X DELETE -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/reviews/comments/33416eef-0fae-4d90-8cd6-f1a14f195ab9 -d {"format":"json"}
      

Request

DELETE /api/2018-01-01/syndication/reviews/comments/33416eef-0fae-4d90-8cd6-f1a14f195ab9 HTTP/1.1 Authorization: Token token=secret Content-Type: application/vnd.api+json { "format": "json" }
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/json

List

Endpoint

GET /api/2018-01-01/syndication/reviews/comments

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Syndication::Reviews::Comment.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/reviews/comments?filter[product_id]=0f400e00-54c4-4f33-8b03-93e70061b21f
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": [ { "id": "e42b60b2-3705-4b31-b34d-5a7e9356e58f", "type": "comments", "attributes": { "title": "example comment", "content": "lorum ipsum getsum", "is_public": true, "is_vendor_response": false, "archived": false, "api_comment": false, "responding_product_id": "9cb29c0c-b1c5-4d23-8ee0-1faea3355d6e", "survey_response": { "id": 483, "product_id": "9cb29c0c-b1c5-4d23-8ee0-1faea3355d6e" }, "user": { "name": "G2 User in Internet" } } } ], "meta": { "record_count": 1, "page_count": 1, "product": { "name": "Product One", "domain": "example.com", "slug": "product-one", "product_type": "Software", "star_rating": 2.5, "avg_rating": "5.0", "detail_description": "Description", "review_count": 0, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://www.g2.com/products/product-one/reviews", "write_review_url": "https://www.g2.com/products/product-one/take_survey" } } }

Parameters

filter[product_id] required The UUID id of the product whose reviews are being commented on.
filter[review_id] The UUID of the review being commented on.
filter[my_api_responses] Limit search to or exclude comments submitted via this API account. (true or false)
filter[vendor_responses] Limit search to or exclude official vendor responses. (true or false)
page[size] Pagination size. (default: 10, max: 100)
page[number] Pagination page. (default: 1)

Response Fields

data Returns the comments as an array.
meta[record_count] Number of total comments available.
meta[page_count] Number of total pages of comments available.
meta[rating] Average rating of the product.
meta[product] Details of the product.

Submit

Comments created through this endpoint will be marked as official responses.

Endpoint

POST /api/2018-01-01/syndication/reviews/:review_id/comments

    

Curl Request

curl -g -X POST -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/reviews/482/comments -d {"format":"json","comment":{"title":"Test title","content":"This is content","user_id":"3fb22a36-24a0-481d-8c98-f32b9de73a3b"}}
      

Request

POST /api/2018-01-01/syndication/reviews/482/comments HTTP/1.1 Authorization: Token token=secret Content-Type: application/vnd.api+json { "format": "json", "comment": { "title": "Test title", "content": "This is content", "user_id": "3fb22a36-24a0-481d-8c98-f32b9de73a3b" } }
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": { "id": "bbb42b6a-5919-496e-811a-77be608bfc1f", "type": "comments", "attributes": { "title": "Test title", "content": "This is content", "is_public": true, "is_vendor_response": true, "archived": false, "api_comment": true, "responding_product_id": "4ad4801a-239b-44dd-99e2-2e7546db48d7", "survey_response": { "id": 482, "product_id": "4ad4801a-239b-44dd-99e2-2e7546db48d7" }, "user": { "name": "G2 User in Internet" } } }, "meta": { "product": { "name": "Product One", "domain": "example.com", "slug": "product-one", "product_type": "Software", "star_rating": 2.5, "avg_rating": "5.0", "detail_description": "Description", "review_count": 0, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://www.g2.com/products/product-one/reviews", "write_review_url": "https://www.g2.com/products/product-one/take_survey" } } }

Parameters

review_id required The UUID of the review being commented on.
comment[content] required Comment content.
comment[title] Comment title.
comment[user_id] UUID of the user attached to the comment. (defaults to product owner)

Response Fields

data Returns the created comment.
meta[product] Details of the product.

Update

Only comments created through this API can be updated through this API.

Endpoint

PUT /api/2018-01-01/syndication/reviews/comments/:id

    

Curl Request

curl -g -X PUT -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/reviews/comments/7af7fc0b-5ecb-4f1a-b9bd-c9acc9f94ec7 -d {"format":"json","comment":{"title":"Test title","content":"This is content"}}
      

Request

PUT /api/2018-01-01/syndication/reviews/comments/7af7fc0b-5ecb-4f1a-b9bd-c9acc9f94ec7 HTTP/1.1 Authorization: Token token=secret Content-Type: application/vnd.api+json { "format": "json", "comment": { "title": "Test title", "content": "This is content" } }
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": { "id": "7af7fc0b-5ecb-4f1a-b9bd-c9acc9f94ec7", "type": "comments", "attributes": { "title": "Test title", "content": "This is content", "is_public": true, "is_vendor_response": false, "archived": false, "api_comment": true, "responding_product_id": "7967b376-a650-4050-bbe0-8b9c63217076", "survey_response": { "id": 484, "product_id": "7967b376-a650-4050-bbe0-8b9c63217076" }, "user": { "name": "G2 User in Internet" } } }, "meta": { "product": { "name": "Product One", "domain": "example.com", "slug": "product-one", "product_type": "Software", "star_rating": 2.5, "avg_rating": "5.0", "detail_description": "Description", "review_count": 0, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://www.g2.com/products/product-one/reviews", "write_review_url": "https://www.g2.com/products/product-one/take_survey" } } }

Parameters

comment[content] required Comment content.
comment[title] Comment title.

Response Fields

data Returns the updated comment.
meta[product] Details of the product.

Syndication::Snippets

List

Endpoint

GET /api/2018-01-01/syndication/snippets

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Syndication::Snippet.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/2018-01-01/syndication/snippets?filter[product_id]=3b9dc82d-8828-4414-8254-a8b0a54fc588
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": [ { "id": "36", "type": "snippets", "attributes": { "content": "This is my Comment", "review": { "id": 576, "default_sort": 0.0, "is_public": true, "slug": "product-one-review-576", "percent_complete": null, "submitted_at": "2020-10-29T14:00:41.516-05:00", "title": "Review title", "url": "https://www.g2.com/products/product-one/reviews/product-one-review-576", "answers": { "love": { "text": "What do you like best?", "value": "I like..." }, "hate": { "text": "What do you dislike?", "value": "I dislike..." } }, "published_at": "2020-10-29T14:00:41.473-05:00", "regions": [ ], "country_name": null, "product_name": "Product One", "source": "Organic", "review_incentive": false, "star_rating": 2.5, "user": { "industry": null, "name": "alex s.", "image": null, "company": null, "title": null }, "verified_current_user": false } } } ], "links": { "self": "https://data.g2.com/api/2018-01-01/syndication/snippets?filter%5Bproduct_id%5D=3b9dc82d-8828-4414-8254-a8b0a54fc588&page%5Bnumber%5D=1&page%5Bsize%5D=10", "first": "https://data.g2.com/api/2018-01-01/syndication/snippets?filter%5Bproduct_id%5D=3b9dc82d-8828-4414-8254-a8b0a54fc588&page%5Bnumber%5D=1&page%5Bsize%5D=10", "prev": null, "next": null, "last": "https://data.g2.com/api/2018-01-01/syndication/snippets?filter%5Bproduct_id%5D=3b9dc82d-8828-4414-8254-a8b0a54fc588&page%5Bnumber%5D=1&page%5Bsize%5D=10" }, "meta": { "aggregates": [ { "filter_name": "nps_score", "collection": [ { "id": 5, "text": "5 star", "count": 0, "checked": false, "nested_boxes": [ ] }, { "id": 4, "text": "4 star", "count": 0, "checked": false, "nested_boxes": [ ] }, { "id": 3, "text": "3 star", "count": 1, "checked": false, "nested_boxes": [ ] }, { "id": 2, "text": "2 star", "count": 0, "checked": false, "nested_boxes": [ ] }, { "id": 1, "text": "1 star", "count": 0, "checked": false, "nested_boxes": [ ] } ], "expanded": true } ], "record_count": 1, "page_count": 1, "product": { "name": "Product One", "domain": "example.com", "slug": "product-one", "product_type": "Software", "star_rating": 2.5, "avg_rating": "5.0", "detail_description": "Description", "review_count": 0, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://www.g2.com/products/product-one/reviews", "write_review_url": "https://www.g2.com/products/product-one/take_survey" } } }

Parameters

filter[product_id] required The UUID id of the product the snippets belong to
page[size] Pagination size (default: 10, max: 100)
page[number] Pagination page (default: 1)
filter[nps_score][] Valid Options: [1, 2, 3, 4, 5]
filter[company_segment][] Valid options are returned under aggregates
filter[industry][] Valid options are returned under aggregates
filter[category_ids][] Valid options are returned under aggregates
filter[role][] Valid options are returned under aggregates
filter[tags][] Valid options are returned under aggregates

Response Fields

data Returns the snippets as an array
links This contains the links for remaining result pages with the same parameters. Returned as self, prev, first, next, and last. next and prev may be blank if you are on the first or last page respectively.
meta[aggregates] This contains the data necessary for building filters. [ { filter_name: the parameter name of the filter to apply i.e. filter[FILTER_NAME][]=, collection: [ { "id": The id used for filtering i.e. filter[FILTER_NAME][]=ID Multiple values are permitted i.e. filter[FILTER_NAME][]=ID&filter[FILTER_NAME][]=ID2, "text": Human readable name of the filter option, "count": # of review that match this filter, "checked": True if the results are currently filtered by this option } ] } ]
meta[record_count] Number of total reviews available
meta[page_count] Number of total pages of reviews available
meta[product] Details of the product the snippets belong to

Vendors

A G2 Seller is a company that owns more than two published G2 Products.

List

Endpoint

GET /api/v1/vendors

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Vendor.all
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/vendors
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "bac2d377-c2cc-445a-99d6-4fbd2192cfcf", "type": "vendors", "links": { "self": "https://data.g2.com/api/v1/vendors/bac2d377-c2cc-445a-99d6-4fbd2192cfcf" }, "attributes": { "name": "Test Vendor", "description": null, "company_website": null, "slug": "test-vendor", "public_products_count": 1, "updated_at": "2020-10-29T14:00:46.578-05:00" }, "relationships": { "products": { "links": { "self": "https://data.g2.com/api/v1/vendors/bac2d377-c2cc-445a-99d6-4fbd2192cfcf/relationships/products", "related": "https://data.g2.com/api/v1/vendors/bac2d377-c2cc-445a-99d6-4fbd2192cfcf/products" } } } } ], "meta": { "record_count": 1, "page_count": 1 }, "links": { "first": "https://data.g2.com/api/v1/vendors?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2.com/api/v1/vendors?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

Parameters

page[size] Pagination size (default: 10, max: 100)
page[number] Pagination page
filter[updated_at_gt] Min time for when a record was last updated. Using rfc3339 format.
filter[updated_at_lt] Max time for when a record was last updated. Using rfc3339 format.

Response Fields

name Name of the Seller
description Description of Seller's company
company_website URL of seller's website
slug URL slug of the seller. e.g. https://g2.com/vendors/:slug
public_products_count Number of Products the Seller has published on G2
updated_at Date seller last updated
data Returns the results as an array
links This contains the links for remaining result pages with the same parameters. Returned as self, prev, first, next, and last. next and prev may be blank if you are on the first or last page respectively.

Show

Endpoint

GET /api/v1/vendors/:id

Ruby Request

require 'g2crowd-ruby' G2crowd::Base.api_token = "secret" G2crowd::Vendor.find(id: 'id')
    

Curl Request

curl -g -X GET -H "Authorization: Token token=secret" -H "Content-Type: application/vnd.api+json" https://data.g2.com/api/v1/vendors/
    

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "195b1415-2d66-4c24-b728-f418b95e5c38", "type": "vendors", "links": { "self": "https://data.g2.com/api/v1/vendors/195b1415-2d66-4c24-b728-f418b95e5c38" }, "attributes": { "name": "Test Vendor", "description": null, "company_website": null, "slug": "test-vendor", "public_products_count": 1, "updated_at": "2020-10-29T14:00:47.746-05:00" }, "relationships": { "products": { "links": { "self": "https://data.g2.com/api/v1/vendors/195b1415-2d66-4c24-b728-f418b95e5c38/relationships/products", "related": "https://data.g2.com/api/v1/vendors/195b1415-2d66-4c24-b728-f418b95e5c38/products" } } } }, { "id": "920eacff-b10e-4952-bf74-66fe8f84726e", "type": "vendors", "links": { "self": "https://data.g2.com/api/v1/vendors/920eacff-b10e-4952-bf74-66fe8f84726e" }, "attributes": { "name": "Test Vendor", "description": null, "company_website": null, "slug": "test-vendor-850de7fc-5034-4587-8504-f56f46357661", "public_products_count": 0, "updated_at": "2020-10-29T14:00:47.867-05:00" }, "relationships": { "products": { "links": { "self": "https://data.g2.com/api/v1/vendors/920eacff-b10e-4952-bf74-66fe8f84726e/relationships/products", "related": "https://data.g2.com/api/v1/vendors/920eacff-b10e-4952-bf74-66fe8f84726e/products" } } } } ], "meta": { "record_count": 2, "page_count": 1 }, "links": { "first": "https://data.g2.com/api/v1/vendors?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2.com/api/v1/vendors?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

Response Fields

name Name of the Seller
description Description of Seller's company
company_website URL of seller's website
slug URL slug of the seller. e.g. https://g2.com/vendors/:slug
public_products_count Number of Products the Seller has published on G2
updated_at Date seller last updated

Libraries