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.

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

Request

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

Request

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

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "5001", "type": "answers", "links": { "self": "https://data.g2crowd.com/api/v1/answers/5001" }, "attributes": { "value": null, "question_type": "industry", "question_text": "What is your industry when using this product?", "input_type": "dropdown", "product_id": "20594bfe-f21d-4cc7-8c95-1a3547fdce99", "survey_response_id": 2799, "question_id": 5799, "created_at": "2019-05-29T02:08:11.814-05:00", "updated_at": "2019-05-29T02:08:11.814-05:00" }, "relationships": { "survey_response": { "links": { "self": "https://data.g2crowd.com/api/v1/answers/5001/relationships/survey-response", "related": "https://data.g2crowd.com/api/v1/answers/5001/survey-response" } }, "question": { "links": { "self": "https://data.g2crowd.com/api/v1/answers/5001/relationships/question", "related": "https://data.g2crowd.com/api/v1/answers/5001/question" } } } } ], "meta": { "record_count": 1, "page_count": 1 }, "links": { "first": "https://data.g2crowd.com/api/v1/answers?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2crowd.com/api/v1/answers?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

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.

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.

Show

Endpoint

GET /api/v1/answers/:id

Request

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

Request

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

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": { "id": "5000", "type": "answers", "links": { "self": "https://data.g2crowd.com/api/v1/answers/5000" }, "attributes": { "value": null, "question_type": "industry", "question_text": "What is your industry when using this product?", "input_type": "dropdown", "product_id": "1b320b44-85fb-460b-916e-4e16ed10562e", "survey_response_id": 2798, "question_id": 5798, "created_at": "2019-05-29T02:08:10.952-05:00", "updated_at": "2019-05-29T02:08:10.952-05:00" }, "relationships": { "survey_response": { "links": { "self": "https://data.g2crowd.com/api/v1/answers/5000/relationships/survey-response", "related": "https://data.g2crowd.com/api/v1/answers/5000/survey-response" } }, "question": { "links": { "self": "https://data.g2crowd.com/api/v1/answers/5000/relationships/question", "related": "https://data.g2crowd.com/api/v1/answers/5000/question" } } } } }

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

List

Endpoint

GET /api/v1/ahoy/companies

Request

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

Request

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

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "123", "type": "companies", "links": { "self": "https://data.g2crowd.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": "" } } ], "meta": { "record_count": 0, "page_count": null }, "links": { "first": "https://data.g2crowd.com/api/v1/ahoy/companies?page%5Bnumber%5D=1&page%5Bsize%5D=10", "next": "https://data.g2crowd.com/api/v1/ahoy/companies?page%5Bnumber%5D=2&page%5Bsize%5D=10" } }

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

Parameters

id Find companies that match provided ids
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.

Show

Endpoint

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

Request

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

Request

curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" 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.g2crowd.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": "" } } }

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::RemoteEventStreams

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.

List

Endpoint

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

Request

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

Request

curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" 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.g2crowd.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": "" }, "relationships": { "company": { "links": { "self": "https://data.g2crowd.com/api/v1/ahoy/remote-event-streams/1/relationships/company", "related": "https://data.g2crowd.com/api/v1/ahoy/remote-event-streams/1/company" } }, "industry": { "links": { "self": "https://data.g2crowd.com/api/v1/ahoy/remote-event-streams/1/relationships/industry", "related": "https://data.g2crowd.com/api/v1/ahoy/remote-event-streams/1/industry" } } } } ], "meta": { "record_count": 0, "page_count": null }, "links": { "first": "https://data.g2crowd.com/api/v1/ahoy/remote-event-streams?page%5Bnumber%5D=1&page%5Bsize%5D=10", "next": "https://data.g2crowd.com/api/v1/ahoy/remote-event-streams?page%5Bnumber%5D=2&page%5Bsize%5D=10" } }

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
title Name of the event
product_ids List of product IDs where the event occurred if applicable
category_ids List of categories within which the events occurred if applicable
user_location Location of the User
organization Name of the organization received events

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

Request

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

Request

curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" 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.g2crowd.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.g2crowd.com/api/v1/attribution-tracking/remote-conversions?page%5Bnumber%5D=1&page%5Bsize%5D=10", "next": "https://data.g2crowd.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

Request

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

Request

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

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "62e3465a-8fb7-4b28-b57a-a66f7ca386b5", "type": "categories", "links": { "self": "https://data.g2crowd.com/api/v1/categories/62e3465a-8fb7-4b28-b57a-a66f7ca386b5" }, "attributes": { "name": "test", "slug": "test-7b767f85-79a3-4342-98cc-6fafbb1bd523", "description": "test", "updated_at": "2019-05-29T02:07:50.484-05:00" }, "relationships": { "products": { "links": { "self": "https://data.g2crowd.com/api/v1/categories/62e3465a-8fb7-4b28-b57a-a66f7ca386b5/relationships/products", "related": "https://data.g2crowd.com/api/v1/categories/62e3465a-8fb7-4b28-b57a-a66f7ca386b5/products" } }, "children": { "links": { "self": "https://data.g2crowd.com/api/v1/categories/62e3465a-8fb7-4b28-b57a-a66f7ca386b5/relationships/children", "related": "https://data.g2crowd.com/api/v1/categories/62e3465a-8fb7-4b28-b57a-a66f7ca386b5/children" } }, "ancestors": { "links": { "self": "https://data.g2crowd.com/api/v1/categories/62e3465a-8fb7-4b28-b57a-a66f7ca386b5/relationships/ancestors", "related": "https://data.g2crowd.com/api/v1/categories/62e3465a-8fb7-4b28-b57a-a66f7ca386b5/ancestors" } }, "descendants": { "links": { "self": "https://data.g2crowd.com/api/v1/categories/62e3465a-8fb7-4b28-b57a-a66f7ca386b5/relationships/descendants", "related": "https://data.g2crowd.com/api/v1/categories/62e3465a-8fb7-4b28-b57a-a66f7ca386b5/descendants" } }, "parent": { "links": { "self": "https://data.g2crowd.com/api/v1/categories/62e3465a-8fb7-4b28-b57a-a66f7ca386b5/relationships/parent", "related": "https://data.g2crowd.com/api/v1/categories/62e3465a-8fb7-4b28-b57a-a66f7ca386b5/parent" } } } } ], "meta": { "record_count": 1, "page_count": 1 }, "links": { "first": "https://data.g2crowd.com/api/v1/categories?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2crowd.com/api/v1/categories?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

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.

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.

Show

Endpoint

GET /api/v1/categories/:id

Request

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

Request

curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" https://data.g2.com/api/v1/categories/52589a33-8387-4636-87f4-23212b3309a9

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": { "id": "52589a33-8387-4636-87f4-23212b3309a9", "type": "categories", "links": { "self": "https://data.g2crowd.com/api/v1/categories/52589a33-8387-4636-87f4-23212b3309a9" }, "attributes": { "name": "test", "slug": "test-ab333c91-0ef2-430c-9f85-600ea6298852", "description": "test", "updated_at": "2019-05-29T02:07:51.844-05:00" }, "relationships": { "products": { "links": { "self": "https://data.g2crowd.com/api/v1/categories/52589a33-8387-4636-87f4-23212b3309a9/relationships/products", "related": "https://data.g2crowd.com/api/v1/categories/52589a33-8387-4636-87f4-23212b3309a9/products" } }, "children": { "links": { "self": "https://data.g2crowd.com/api/v1/categories/52589a33-8387-4636-87f4-23212b3309a9/relationships/children", "related": "https://data.g2crowd.com/api/v1/categories/52589a33-8387-4636-87f4-23212b3309a9/children" } }, "ancestors": { "links": { "self": "https://data.g2crowd.com/api/v1/categories/52589a33-8387-4636-87f4-23212b3309a9/relationships/ancestors", "related": "https://data.g2crowd.com/api/v1/categories/52589a33-8387-4636-87f4-23212b3309a9/ancestors" } }, "descendants": { "links": { "self": "https://data.g2crowd.com/api/v1/categories/52589a33-8387-4636-87f4-23212b3309a9/relationships/descendants", "related": "https://data.g2crowd.com/api/v1/categories/52589a33-8387-4636-87f4-23212b3309a9/descendants" } }, "parent": { "links": { "self": "https://data.g2crowd.com/api/v1/categories/52589a33-8387-4636-87f4-23212b3309a9/relationships/parent", "related": "https://data.g2crowd.com/api/v1/categories/52589a33-8387-4636-87f4-23212b3309a9/parent" } } } } }

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

Request

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

Request

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

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "f0ab9a80-15b3-4c5b-854b-1fa84b6e84b7", "type": "products", "links": { "self": "https://data.g2crowd.com/api/v1/products/f0ab9a80-15b3-4c5b-854b-1fa84b6e84b7" }, "attributes": { "product_type": "Software", "name": "test product 31", "short_name": "test product 31", "domain": "example.com", "slug": "test-product-31", "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://localhost:3000/products/test-product-31/reviews", "languages_supported": null, "updated_at": "2019-05-29T02:08:23.606-05:00", "created_at": "2019-05-29T02:08:23.521-05:00" }, "relationships": { "categories": { "links": { "self": "https://data.g2crowd.com/api/v1/products/f0ab9a80-15b3-4c5b-854b-1fa84b6e84b7/relationships/categories", "related": "https://data.g2crowd.com/api/v1/products/f0ab9a80-15b3-4c5b-854b-1fa84b6e84b7/categories" } }, "survey_responses": { "links": { "self": "https://data.g2crowd.com/api/v1/products/f0ab9a80-15b3-4c5b-854b-1fa84b6e84b7/relationships/survey-responses", "related": "https://data.g2crowd.com/api/v1/products/f0ab9a80-15b3-4c5b-854b-1fa84b6e84b7/survey-responses" } }, "main_category": { "links": { "self": "https://data.g2crowd.com/api/v1/products/f0ab9a80-15b3-4c5b-854b-1fa84b6e84b7/relationships/main-category", "related": "https://data.g2crowd.com/api/v1/products/f0ab9a80-15b3-4c5b-854b-1fa84b6e84b7/main-category" } }, "vendor": { "links": { "self": "https://data.g2crowd.com/api/v1/products/f0ab9a80-15b3-4c5b-854b-1fa84b6e84b7/relationships/vendor", "related": "https://data.g2crowd.com/api/v1/products/f0ab9a80-15b3-4c5b-854b-1fa84b6e84b7/vendor" } } } } ], "meta": { "record_count": 1, "page_count": 1 }, "links": { "first": "https://data.g2crowd.com/api/v1/products?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2crowd.com/api/v1/products?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

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 Vendor-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

Parameters

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

List Reviews for Product

Endpoint

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

      
curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" https://data.g2.com/api/v1/products/:id/survey-responses
      
    
      
Simulated Response

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "2806",
      "type": "survey_responses",
      "links": {
        "self": "https://data.g2crowd.com/api/v1/survey-responses/2806"
      },
      "attributes": {
        "default_sort": 0.0,
        "product_name": "test product 32",
        "is_public": true,
        "slug": "test-product-32-review-2806",
        "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": "a15ff2a5-b631-41ae-ba38-8b766cc97d2d",
        "user_name": "alex smith",
        "user_image_url": null,
        "submitted_at": "2019-05-29T02:08:23.998-05:00",
        "updated_at": "2019-05-29T02:08:23.978-05:00",
        "moderated_at": null,
        "product_id": "ecd5dedf-6d99-4e73-935e-7d3971763dcb",
        "reference_user_consent": "unanswered"
      },
      "relationships": {
        "product": {
          "links": {
            "self": "https://data.g2crowd.com/api/v1/survey-responses/2806/relationships/product",
            "related": "https://data.g2crowd.com/api/v1/survey-responses/2806/product"
          }
        },
        "questions": {
          "links": {
            "self": "https://data.g2crowd.com/api/v1/survey-responses/2806/relationships/questions",
            "related": "https://data.g2crowd.com/api/v1/survey-responses/2806/questions"
          }
        },
        "answers": {
          "links": {
            "self": "https://data.g2crowd.com/api/v1/survey-responses/2806/relationships/answers",
            "related": "https://data.g2crowd.com/api/v1/survey-responses/2806/answers"
          }
        }
      }
    }
  ],
  "meta": {
    "record_count": 1,
    "page_count": 1
  },
  "links": {
    "first": "https://data.g2crowd.com/api/v1/products/ecd5dedf-6d99-4e73-935e-7d3971763dcb/survey-responses?page%5Bnumber%5D=1&page%5Bsize%5D=10",
    "last": "https://data.g2crowd.com/api/v1/products/ecd5dedf-6d99-4e73-935e-7d3971763dcb/survey-responses?page%5Bnumber%5D=1&page%5Bsize%5D=10"
  }
}
      
    

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 Vendor-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 external mappings

Endpoint

GET /api/v1/product-mappings

      
curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" https://data.g2.com/api/v1/product-mappings
      
    
      
Simulated Response

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "identifier_other-id",
      "type": "product_mappings",
      "links": {
        "self": "https://data.g2crowd.com/api/v1/product-mappings/identifier_other-id"
      },
      "attributes": {
        "realm": "identifier",
        "product_id": "e07f3ddd-ad61-4f1f-a4c4-117ee9255cb6",
        "external_id": "other-id"
      },
      "relationships": {
        "product": {
          "links": {
            "self": "https://data.g2crowd.com/api/v1/product-mappings/identifier_other-id/relationships/product",
            "related": "https://data.g2crowd.com/api/v1/product-mappings/identifier_other-id/product"
          }
        }
      }
    }
  ],
  "meta": {
    "record_count": 1,
    "page_count": 1
  },
  "links": {
    "first": "https://data.g2crowd.com/api/v1/product-mappings?page%5Bnumber%5D=1&page%5Bsize%5D=10",
    "last": "https://data.g2crowd.com/api/v1/product-mappings?page%5Bnumber%5D=1&page%5Bsize%5D=10"
  }
}
      
    

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 Vendor-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

Request

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

Request

curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" https://data.g2.com/api/v1/products/f9d94470-acd3-4a3a-a788-64e4fc46b559

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": { "id": "f9d94470-acd3-4a3a-a788-64e4fc46b559", "type": "products", "links": { "self": "https://data.g2crowd.com/api/v1/products/f9d94470-acd3-4a3a-a788-64e4fc46b559" }, "attributes": { "product_type": "Software", "name": "test product 23", "short_name": "test product 23", "domain": "example.com", "slug": "test-product-23", "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://localhost:3000/products/test-product-23/reviews", "languages_supported": null, "updated_at": "2019-05-29T02:08:21.013-05:00", "created_at": "2019-05-29T02:08:20.923-05:00" }, "relationships": { "categories": { "links": { "self": "https://data.g2crowd.com/api/v1/products/f9d94470-acd3-4a3a-a788-64e4fc46b559/relationships/categories", "related": "https://data.g2crowd.com/api/v1/products/f9d94470-acd3-4a3a-a788-64e4fc46b559/categories" } }, "survey_responses": { "links": { "self": "https://data.g2crowd.com/api/v1/products/f9d94470-acd3-4a3a-a788-64e4fc46b559/relationships/survey-responses", "related": "https://data.g2crowd.com/api/v1/products/f9d94470-acd3-4a3a-a788-64e4fc46b559/survey-responses" } }, "main_category": { "links": { "self": "https://data.g2crowd.com/api/v1/products/f9d94470-acd3-4a3a-a788-64e4fc46b559/relationships/main-category", "related": "https://data.g2crowd.com/api/v1/products/f9d94470-acd3-4a3a-a788-64e4fc46b559/main-category" } }, "vendor": { "links": { "self": "https://data.g2crowd.com/api/v1/products/f9d94470-acd3-4a3a-a788-64e4fc46b559/relationships/vendor", "related": "https://data.g2crowd.com/api/v1/products/f9d94470-acd3-4a3a-a788-64e4fc46b559/vendor" } } } } }

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 Vendor-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 external mapping

Endpoint

GET /api/v1/product-mappings/:id

      
curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" https://data.g2.com/api/v1/product-mappings/:id
      
    
      
Simulated Response

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "identifier_other-id",
    "type": "product_mappings",
    "links": {
      "self": "https://data.g2crowd.com/api/v1/product-mappings/identifier_other-id"
    },
    "attributes": {
      "realm": "identifier",
      "product_id": "714d8c04-287d-4359-8874-6ef070038d68",
      "external_id": "other-id"
    },
    "relationships": {
      "product": {
        "links": {
          "self": "https://data.g2crowd.com/api/v1/product-mappings/identifier_other-id/relationships/product",
          "related": "https://data.g2crowd.com/api/v1/product-mappings/identifier_other-id/product"
        }
      }
    }
  }
}
      
    

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 Vendor-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

Request

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

Request

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

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "5789", "type": "questions", "links": { "self": "https://data.g2crowd.com/api/v1/questions/5789" }, "attributes": { "title": "Industry", "text_template": "What is your industry when using this product?", "is_required": true, "description": null, "question_type": "industry", "input_type": "dropdown" }, "relationships": { "survey_responses": { "links": { "self": "https://data.g2crowd.com/api/v1/questions/5789/relationships/survey-responses", "related": "https://data.g2crowd.com/api/v1/questions/5789/survey-responses" } }, "answers": { "links": { "self": "https://data.g2crowd.com/api/v1/questions/5789/relationships/answers", "related": "https://data.g2crowd.com/api/v1/questions/5789/answers" } } } }, { "id": "5790", "type": "questions", "links": { "self": "https://data.g2crowd.com/api/v1/questions/5790" }, "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.g2crowd.com/api/v1/questions/5790/relationships/survey-responses", "related": "https://data.g2crowd.com/api/v1/questions/5790/survey-responses" } }, "answers": { "links": { "self": "https://data.g2crowd.com/api/v1/questions/5790/relationships/answers", "related": "https://data.g2crowd.com/api/v1/questions/5790/answers" } } } }, { "id": "5791", "type": "questions", "links": { "self": "https://data.g2crowd.com/api/v1/questions/5791" }, "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.g2crowd.com/api/v1/questions/5791/relationships/survey-responses", "related": "https://data.g2crowd.com/api/v1/questions/5791/survey-responses" } }, "answers": { "links": { "self": "https://data.g2crowd.com/api/v1/questions/5791/relationships/answers", "related": "https://data.g2crowd.com/api/v1/questions/5791/answers" } } } } ], "meta": { "record_count": 3, "page_count": 1 }, "links": { "first": "https://data.g2crowd.com/api/v1/questions?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2crowd.com/api/v1/questions?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

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", "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.

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.

Show

Endpoint

GET /api/v1/questions/:id

Request

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

Request

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

Response

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

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", "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

Request

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

Request

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

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "526", "type": "resource_subscriptions", "links": { "self": "https://data.g2crowd.com/api/v1/resource-subscriptions/526" }, "attributes": { "post_url": "http://www.example.com", "subscribed_resource": "leads", "updated_at": "2019-05-29T02:08:28.007-05:00", "product_uuid": "ea582cfe-93ef-4d56-94ea-0896fd7f730c", "product_id": 7908 } } ], "meta": { "record_count": 1, "page_count": 1 }, "links": { "first": "https://data.g2crowd.com/api/v1/resource-subscriptions?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2crowd.com/api/v1/resource-subscriptions?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

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.

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.

Show

Endpoint

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

Request

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

Request

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

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": { "id": "525", "type": "resource_subscriptions", "links": { "self": "https://data.g2crowd.com/api/v1/resource-subscriptions/525" }, "attributes": { "post_url": "http://www.example.com", "subscribed_resource": "leads", "updated_at": "2019-05-29T02:08:27.598-05:00", "product_uuid": "adcb5c55-c759-4a47-8a6a-fe44dffa87d1", "product_id": 7907 } } }

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 -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" https://data.g2.com/api/v1/resource-subscriptions
      
    
      
Simulated Response

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "524",
    "type": "resource_subscriptions",
    "links": {
      "self": "https://data.g2crowd.com/api/v1/resource-subscriptions/524"
    },
    "attributes": {
      "post_url": "http://requestb.in",
      "subscribed_resource": "leads",
      "updated_at": "2019-05-29T02:08:27.325-05:00",
      "product_uuid": "bbcbbf1c-51f8-466e-b695-f17942cc0ac4",
      "product_id": 7906
    }
  }
}
      
    

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

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

Un-subscribe

Endpoint

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

      
curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" https://data.g2.com/api/v1/resource-subscriptions/:id
      
    
      
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

Request

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

Request

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

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "2792", "type": "survey_responses", "links": { "self": "https://data.g2crowd.com/api/v1/survey-responses/2792" }, "attributes": { "default_sort": 0.0, "product_name": "test product 6", "is_public": true, "slug": "test-product-6-review-2792", "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": "a64f6c2b-31d4-494a-a19e-841e5dae2b70", "user_name": "alex smith", "user_image_url": null, "submitted_at": "2019-05-29T02:07:55.895-05:00", "updated_at": "2019-05-29T02:07:55.873-05:00", "moderated_at": null, "product_id": "70816110-f7ab-449e-a303-63798de9924a", "reference_user_consent": "unanswered" }, "relationships": { "product": { "links": { "self": "https://data.g2crowd.com/api/v1/survey-responses/2792/relationships/product", "related": "https://data.g2crowd.com/api/v1/survey-responses/2792/product" } }, "questions": { "links": { "self": "https://data.g2crowd.com/api/v1/survey-responses/2792/relationships/questions", "related": "https://data.g2crowd.com/api/v1/survey-responses/2792/questions" } }, "answers": { "links": { "self": "https://data.g2crowd.com/api/v1/survey-responses/2792/relationships/answers", "related": "https://data.g2crowd.com/api/v1/survey-responses/2792/answers" } } } } ], "meta": { "record_count": 1, "page_count": 1 }, "links": { "first": "https://data.g2crowd.com/api/v1/survey-responses?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2crowd.com/api/v1/survey-responses?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

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

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.

Show

Endpoint

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

Request

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

Request

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

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": { "id": "2787", "type": "survey_responses", "links": { "self": "https://data.g2crowd.com/api/v1/survey-responses/2787" }, "attributes": { "default_sort": 0.0, "product_name": "test product 2", "is_public": true, "slug": "test-product-2-review-2787", "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": "27cca311-b4d3-4509-ab40-8682c4eefeda", "user_name": "alex smith", "user_image_url": null, "submitted_at": "2019-05-29T02:07:52.839-05:00", "updated_at": "2019-05-29T02:07:52.786-05:00", "moderated_at": null, "product_id": "c3d5620a-820c-4f2b-bd04-6024cb3fa641", "reference_user_consent": "unanswered" }, "relationships": { "product": { "links": { "self": "https://data.g2crowd.com/api/v1/survey-responses/2787/relationships/product", "related": "https://data.g2crowd.com/api/v1/survey-responses/2787/product" } }, "questions": { "links": { "self": "https://data.g2crowd.com/api/v1/survey-responses/2787/relationships/questions", "related": "https://data.g2crowd.com/api/v1/survey-responses/2787/questions" } }, "answers": { "links": { "self": "https://data.g2crowd.com/api/v1/survey-responses/2787/relationships/answers", "related": "https://data.g2crowd.com/api/v1/survey-responses/2787/answers" } } } } }

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
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::IntegrationReviews

List

Endpoint

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

Request

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

Request

curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" https://data.g2.com/api/2018-01-01/syndication/integration_reviews

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": [ { "id": "175", "type": "integration_reviews", "attributes": { "product_name": "Product One", "primary_product_name": "Product Two", "submitted_at": "2019-05-22T02:08:32.314-05:00", "published_at": "2019-05-29T02:08:32.032-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": 2.0, "user": { "industry": "Facilities Services", "company_segment": null, "name": "alex s.", "image": null, "title": null, "company": "ACME" }, "review": { "id": 2818, "title": "Review Title", "g2crowd_url": "https://g2.com/survey_responses/product-one-review-2818", "review_incentive": false, "verified_current_user": true } } } ], "links": { "self": "http://example.org/api/2018-01-01/syndication/integration_reviews?filter%5Bprimary_product_id%5D=bb2d7382-3e75-4a7a-a96e-33fd1ad223a5&filter%5Bproduct_id%5D=22335140-7e62-458b-b132-a741abd77e0d&page%5Bnumber%5D=1&page%5Bsize%5D=10", "first": "http://example.org/api/2018-01-01/syndication/integration_reviews?filter%5Bprimary_product_id%5D=bb2d7382-3e75-4a7a-a96e-33fd1ad223a5&filter%5Bproduct_id%5D=22335140-7e62-458b-b132-a741abd77e0d&page%5Bnumber%5D=1&page%5Bsize%5D=10", "prev": null, "next": null, "last": "http://example.org/api/2018-01-01/syndication/integration_reviews?filter%5Bprimary_product_id%5D=bb2d7382-3e75-4a7a-a96e-33fd1ad223a5&filter%5Bproduct_id%5D=22335140-7e62-458b-b132-a741abd77e0d&page%5Bnumber%5D=1&page%5Bsize%5D=10" }, "meta": { "aggregates": [ { "filter_name": "nps_score", "collection": [ { "id": 5, "text": "5 star", "count": 0, "checked": false }, { "id": 4, "text": "4 star", "count": 0, "checked": false }, { "id": 3, "text": "3 star", "count": 0, "checked": false }, { "id": 2, "text": "2 star", "count": 1, "checked": false }, { "id": 1, "text": "1 star", "count": 0, "checked": false } ], "expanded": true } ], "record_count": 1, "page_count": 1, "product": { "name": "Product One", "domain": "example.com", "slug": "product-one", "product_type": "Software", "star_rating": 1, "avg_rating": "0.3", "detail_description": "Description of product", "review_count": 3, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://g2.com/products/product-one", "write_review_url": "https://g2.com/products/product-one/take_survey" } } }

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

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

Syndication::Products

List

Endpoint

GET /api/2018-01-01/syndication/products

Request

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

Request

curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" https://data.g2.com/api/2018-01-01/syndication/products

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": [ { "id": "34ffdded-e894-46ef-8d91-72eda7eac400", "type": "softwares", "attributes": { "product": { "name": "Product One", "domain": "example.com", "slug": "product-one", "product_type": "Software", "star_rating": 1, "avg_rating": "0.3", "detail_description": "Description of product", "review_count": 3, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://g2.com/products/product-one", "write_review_url": "https://g2.com/products/product-one/take_survey" }, "main_category": { "28781edc-27da-497d-a690-f09605dfb311": { "name": "Example Category", "slug": "example-category", "description": "Example Category is...", "product_count": 1 } }, "categories": { "af3d7d23-9a4f-4506-a01a-27eed9dfc551": { "name": "test", "slug": "test", "description": "test", "product_count": 0 }, "28781edc-27da-497d-a690-f09605dfb311": { "name": "Example Category", "slug": "example-category", "description": "Example Category is...", "product_count": 1 } } } } ], "links": { "self": "http://example.org/api/2018-01-01/syndication/products?page%5Bnumber%5D=1&page%5Bsize%5D=10", "first": "http://example.org/api/2018-01-01/syndication/products?page%5Bnumber%5D=1&page%5Bsize%5D=10", "prev": null, "next": null, "last": "http://example.org/api/2018-01-01/syndication/products?page%5Bnumber%5D=1&page%5Bsize%5D=10" }, "meta": { "aggregates": [ { "filter_name": "star_rating", "collection": [ { "id": 0, "text": "Unrated", "count": 0 }, { "id": 1, "text": "1 Star", "count": 1 }, { "id": 2, "text": "2 Star", "count": 0 }, { "id": 3, "text": "3 Star", "count": 0 }, { "id": 4, "text": "4 Star", "count": 0 }, { "id": 5, "text": "5 Star", "count": 0 } ] } ], "record_count": 1, "page_count": 1 } }

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

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

Show

Endpoint

GET /api/2018-01-01/syndication/products/:id

Request

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

Request

curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" https://data.g2.com/api/2018-01-01/syndication/products/911732fc-e537-4f1a-8518-474e892581f8

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": { "id": "911732fc-e537-4f1a-8518-474e892581f8", "type": "softwares", "attributes": { "product": { "name": "Product One", "domain": "example.com", "slug": "product-one", "product_type": "Software", "star_rating": 1, "avg_rating": "0.3", "detail_description": "Description of product", "review_count": 3, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://g2.com/products/product-one", "write_review_url": "https://g2.com/products/product-one/take_survey" }, "main_category": { "6b910e72-ae1f-426a-a760-271353540409": { "name": "Example Category", "slug": "example-category", "description": "Example Category is...", "product_count": 1 } }, "categories": { "16bae39b-1a05-41a4-9468-d34045cb0282": { "name": "test", "slug": "test", "description": "test", "product_count": 0 }, "6b910e72-ae1f-426a-a760-271353540409": { "name": "Example Category", "slug": "example-category", "description": "Example Category is...", "product_count": 1 } } } } }

Syndication::Reviews

List

Endpoint

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

Request

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

Request

curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" https://data.g2.com/api/2018-01-01/syndication/reviews

Response

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

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

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[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")

Syndication::Snippets

List

Endpoint

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

Request

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

Request

curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" https://data.g2.com/api/2018-01-01/syndication/snippets

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json; charset=utf-8 { "data": [ { "id": "172", "type": "snippets", "attributes": { "content": "This is my Comment", "review": { "id": 2803, "default_sort": 0.0, "is_public": true, "slug": "product-one-review-2803", "percent_complete": null, "submitted_at": "2019-05-29T02:08:18.681-05:00", "title": "Review title", "url": "https://g2.com/products/product-one/reviews/product-one-review-2803", "answers": { "love": { "text": "What do you like best?", "value": "I like..." }, "hate": { "text": "What do you dislike?", "value": "I dislike..." } }, "published_at": "2019-05-29T02:08:18.660-05:00", "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": "http://example.org/api/2018-01-01/syndication/snippets?filter%5Bproduct_id%5D=759c8c0c-2ed5-410c-844b-f7e5742e86b9&page%5Bnumber%5D=1&page%5Bsize%5D=10", "first": "http://example.org/api/2018-01-01/syndication/snippets?filter%5Bproduct_id%5D=759c8c0c-2ed5-410c-844b-f7e5742e86b9&page%5Bnumber%5D=1&page%5Bsize%5D=10", "prev": null, "next": null, "last": "http://example.org/api/2018-01-01/syndication/snippets?filter%5Bproduct_id%5D=759c8c0c-2ed5-410c-844b-f7e5742e86b9&page%5Bnumber%5D=1&page%5Bsize%5D=10" }, "meta": { "aggregates": [ { "filter_name": "nps_score", "collection": [ { "id": 5, "text": "5 star", "count": 0, "checked": false }, { "id": 4, "text": "4 star", "count": 0, "checked": false }, { "id": 3, "text": "3 star", "count": 1, "checked": false }, { "id": 2, "text": "2 star", "count": 0, "checked": false }, { "id": 1, "text": "1 star", "count": 0, "checked": false } ], "expanded": true } ], "record_count": 1, "page_count": 1, "product": { "name": "Product One", "domain": "example.com", "slug": "product-one", "product_type": "Software", "star_rating": 1, "avg_rating": "0.3", "detail_description": "Description of product", "review_count": 3, "image_url": null, "public_detail_url": null, "g2crowd_url": "https://g2.com/products/product-one", "write_review_url": "https://g2.com/products/product-one/take_survey" } } }

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

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

Users

The User model on G2 represents all G2 users, whether they are buyers or vendors. In most cases, you will only want to access this URL in relation to a Review.

List

Endpoint

GET /api/v1/users

Request

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

Request

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

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "70a3582e-1586-4690-930f-d9523461d48e", "type": "users", "links": { "self": "https://data.g2crowd.com/api/v1/users/70a3582e-1586-4690-930f-d9523461d48e" }, "attributes": { "first_name": "alex", "last_name": "smith", "company_size": null, "image_url": null, "industry": "Internet", "headline": null, "public_detail_url": "https://localhost:3000/users/70a3582e-1586-4690-930f-d9523461d48e", "created_at": "2019-05-29T02:07:48.362-05:00", "updated_at": "2019-05-29T02:07:48.362-05:00" }, "relationships": { "product": { "links": { "self": "https://data.g2crowd.com/api/v1/users/70a3582e-1586-4690-930f-d9523461d48e/relationships/product", "related": "https://data.g2crowd.com/api/v1/users/70a3582e-1586-4690-930f-d9523461d48e/product" } } } }, { "id": "84aebc7e-2e41-471a-b940-82fddf365f18", "type": "users", "links": { "self": "https://data.g2crowd.com/api/v1/users/84aebc7e-2e41-471a-b940-82fddf365f18" }, "attributes": { "first_name": "alex", "last_name": "smith", "company_size": null, "image_url": null, "industry": "Internet", "headline": null, "public_detail_url": "https://localhost:3000/users/84aebc7e-2e41-471a-b940-82fddf365f18", "created_at": "2019-05-29T02:07:48.261-05:00", "updated_at": "2019-05-29T02:07:48.261-05:00" }, "relationships": { "product": { "links": { "self": "https://data.g2crowd.com/api/v1/users/84aebc7e-2e41-471a-b940-82fddf365f18/relationships/product", "related": "https://data.g2crowd.com/api/v1/users/84aebc7e-2e41-471a-b940-82fddf365f18/product" } } } } ], "meta": { "record_count": 2, "page_count": 1 }, "links": { "first": "https://data.g2crowd.com/api/v1/users?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2crowd.com/api/v1/users?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

Response Fields

first_name First name of the user
last_name Last name of the user
company_size Size of the user's company
image_url URL of user's avatar
industry Industry of the user
headline Brief description of the user
public_detail_url URL to user profile on G2
created_at Date user signed up to G2
updated_at Date user 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.

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.

Show

Endpoint

GET /api/v1/users/:id

Request

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

Request

curl -X GET -H "Content-type: application/vnd.api+json" -H "Authorization: Token token=secret" https://data.g2.com/api/v1/users/81f9140a-0fcb-4231-868d-ecde5df18537

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": { "id": "81f9140a-0fcb-4231-868d-ecde5df18537", "type": "users", "links": { "self": "https://data.g2crowd.com/api/v1/users/81f9140a-0fcb-4231-868d-ecde5df18537" }, "attributes": { "first_name": "alex", "last_name": "smith", "company_size": null, "image_url": null, "industry": "Internet", "headline": null, "public_detail_url": "https://localhost:3000/users/81f9140a-0fcb-4231-868d-ecde5df18537", "created_at": "2019-05-29T02:07:47.986-05:00", "updated_at": "2019-05-29T02:07:47.986-05:00" }, "relationships": { "product": { "links": { "self": "https://data.g2crowd.com/api/v1/users/81f9140a-0fcb-4231-868d-ecde5df18537/relationships/product", "related": "https://data.g2crowd.com/api/v1/users/81f9140a-0fcb-4231-868d-ecde5df18537/product" } } } } }

Response Fields

first_name First name of the user
last_name Last name of the user
company_size Size of the user's company
image_url URL of user's avatar
industry Industry of the user
headline Brief description of the user
public_detail_url URL to user profile on G2
created_at Date user signed up to G2
updated_at Date user last updated

Vendors

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

List

Endpoint

GET /api/v1/vendors

Request

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

Request

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

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "36482fcd-6237-4a99-a606-251fcc16170e", "type": "vendors", "links": { "self": "https://data.g2crowd.com/api/v1/vendors/36482fcd-6237-4a99-a606-251fcc16170e" }, "attributes": { "name": "Test Vendor", "description": null, "company_website": null, "slug": "test-vendor", "public_products_count": 1, "updated_at": "2019-05-29T02:08:33.494-05:00" }, "relationships": { "products": { "links": { "self": "https://data.g2crowd.com/api/v1/vendors/36482fcd-6237-4a99-a606-251fcc16170e/relationships/products", "related": "https://data.g2crowd.com/api/v1/vendors/36482fcd-6237-4a99-a606-251fcc16170e/products" } } } } ], "meta": { "record_count": 1, "page_count": 1 }, "links": { "first": "https://data.g2crowd.com/api/v1/vendors?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2crowd.com/api/v1/vendors?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

Response Fields

name Name of the Vendor
description Description of Vendor's company
company_website URL of vendor's website
slug URL slug of the vendor. e.g. https://g2.com/vendors/:slug
public_products_count Number of Products the Vendor has published on G2
updated_at Date vendor 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.

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.

Show

Endpoint

GET /api/v1/vendors/:id

Request

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

Request

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

Response

Simulated Response HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [ { "id": "bd2126f8-65bd-4d83-9ff4-61ab833809f7", "type": "vendors", "links": { "self": "https://data.g2crowd.com/api/v1/vendors/bd2126f8-65bd-4d83-9ff4-61ab833809f7" }, "attributes": { "name": "Test Vendor", "description": null, "company_website": null, "slug": "test-vendor", "public_products_count": 1, "updated_at": "2019-05-29T02:08:32.725-05:00" }, "relationships": { "products": { "links": { "self": "https://data.g2crowd.com/api/v1/vendors/bd2126f8-65bd-4d83-9ff4-61ab833809f7/relationships/products", "related": "https://data.g2crowd.com/api/v1/vendors/bd2126f8-65bd-4d83-9ff4-61ab833809f7/products" } } } }, { "id": "df94b2cb-dd25-4d5f-8a31-c7407b49b771", "type": "vendors", "links": { "self": "https://data.g2crowd.com/api/v1/vendors/df94b2cb-dd25-4d5f-8a31-c7407b49b771" }, "attributes": { "name": "Test Vendor", "description": null, "company_website": null, "slug": "test-vendor-98750e8b-167d-43b5-98ea-1fafe5dcb058", "public_products_count": 0, "updated_at": "2019-05-29T02:08:32.827-05:00" }, "relationships": { "products": { "links": { "self": "https://data.g2crowd.com/api/v1/vendors/df94b2cb-dd25-4d5f-8a31-c7407b49b771/relationships/products", "related": "https://data.g2crowd.com/api/v1/vendors/df94b2cb-dd25-4d5f-8a31-c7407b49b771/products" } } } } ], "meta": { "record_count": 2, "page_count": 1 }, "links": { "first": "https://data.g2crowd.com/api/v1/vendors?page%5Bnumber%5D=1&page%5Bsize%5D=10", "last": "https://data.g2crowd.com/api/v1/vendors?page%5Bnumber%5D=1&page%5Bsize%5D=10" } }

Response Fields

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

Libraries