@datafire/google_factchecktools
Client library for Fact Check Tools API
Installation and Usage
npm install --save @datafire/google_factchecktools
let google_factchecktools = require('@datafire/google_factchecktools').create({
access_token: "",
refresh_token: "",
client_id: "",
client_secret: "",
redirect_uri: ""
});
.then(data => {
console.log(data);
});
Description
Actions
oauthCallback
Exchange the code passed to your redirect URI for an access_token
google_factchecktools.oauthCallback({
"code": ""
}, context)
Input
- input
object
- code required
string
- code required
Output
- output
object
- access_token
string
- refresh_token
string
- token_type
string
- scope
string
- expiration
string
- access_token
oauthRefresh
Exchange a refresh_token for an access_token
google_factchecktools.oauthRefresh(null, context)
Input
This action has no parameters
Output
- output
object
- access_token
string
- refresh_token
string
- token_type
string
- scope
string
- expiration
string
- access_token
factchecktools.claims.search
Search through fact-checked claims.
google_factchecktools.factchecktools.claims.search({}, context)
Input
- input
object
- languageCode
string
: The BCP-47 language code, such as "en-US" or "sr-Latn". Can be used to restrict results by language, though we do not currently consider the region. - maxAgeDays
integer
: The maximum age of the returned search results, in days. Age is determined by either claim date or review date, whichever is newer. - offset
integer
: An integer that specifies the current offset (that is, starting result location) in search results. This field is only considered ifpage_token
is unset. For example, 0 means to return results starting from the first matching result, and 10 means to return from the 11th result. - pageSize
integer
: The pagination size. We will return up to that many results. Defaults to 10 if not set. - pageToken
string
: The pagination token. You may provide thenext_page_token
returned from a previous List request, if any, in order to get the next page. All other fields must have the same values as in the previous request. - query
string
: Textual query string. Required unlessreview_publisher_site_filter
is specified. - reviewPublisherSiteFilter
string
: The review publisher site to filter results by, e.g. nytimes.com. - $.xgafv
string
(values: 1, 2): V1 error format. - access_token
string
: OAuth access token. - alt
string
(values: json, media, proto): Data format for response. - callback
string
: JSONP - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - upload_protocol
string
: Upload protocol for media (e.g. "raw", "multipart"). - uploadType
string
: Legacy upload protocol for media (e.g. "media", "multipart").
- languageCode
Output
factchecktools.pages.list
List the ClaimReview
markup pages for a specific URL or for an organization.
google_factchecktools.factchecktools.pages.list({}, context)
Input
- input
object
- offset
integer
: An integer that specifies the current offset (that is, starting result location) in search results. This field is only considered ifpage_token
is unset, and if the request is not for a specific URL. For example, 0 means to return results starting from the first matching result, and 10 means to return from the 11th result. - organization
string
: The organization for which we want to fetch markups for. For instance, "site.com". Cannot be specified along with an URL. - pageSize
integer
: The pagination size. We will return up to that many results. Defaults to 10 if not set. Has no effect if a URL is requested. - pageToken
string
: The pagination token. You may provide thenext_page_token
returned from a previous List request, if any, in order to get the next page. All other fields must have the same values as in the previous request. - url
string
: The URL from which to getClaimReview
markup. There will be at most one result. If markup is associated with a more canonical version of the URL provided, we will return that URL instead. Cannot be specified along with an organization. - $.xgafv
string
(values: 1, 2): V1 error format. - access_token
string
: OAuth access token. - alt
string
(values: json, media, proto): Data format for response. - callback
string
: JSONP - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - upload_protocol
string
: Upload protocol for media (e.g. "raw", "multipart"). - uploadType
string
: Legacy upload protocol for media (e.g. "media", "multipart").
- offset
Output
factchecktools.pages.create
Create ClaimReview
markup on a page.
google_factchecktools.factchecktools.pages.create({}, context)
Input
- input
object
- body GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage
- $.xgafv
string
(values: 1, 2): V1 error format. - access_token
string
: OAuth access token. - alt
string
(values: json, media, proto): Data format for response. - callback
string
: JSONP - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - upload_protocol
string
: Upload protocol for media (e.g. "raw", "multipart"). - uploadType
string
: Legacy upload protocol for media (e.g. "media", "multipart").
Output
factchecktools.pages.delete
Delete all ClaimReview
markup on a page.
google_factchecktools.factchecktools.pages.delete({
"name": ""
}, context)
Input
- input
object
- name required
string
: The name of the resource to delete, in the form ofpages/{page_id}
. - $.xgafv
string
(values: 1, 2): V1 error format. - access_token
string
: OAuth access token. - alt
string
(values: json, media, proto): Data format for response. - callback
string
: JSONP - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - upload_protocol
string
: Upload protocol for media (e.g. "raw", "multipart"). - uploadType
string
: Legacy upload protocol for media (e.g. "media", "multipart").
- name required
Output
- output GoogleProtobufEmpty
factchecktools.pages.get
Get all ClaimReview
markup on a page.
google_factchecktools.factchecktools.pages.get({
"name": ""
}, context)
Input
- input
object
- name required
string
: The name of the resource to get, in the form ofpages/{page_id}
. - $.xgafv
string
(values: 1, 2): V1 error format. - access_token
string
: OAuth access token. - alt
string
(values: json, media, proto): Data format for response. - callback
string
: JSONP - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - upload_protocol
string
: Upload protocol for media (e.g. "raw", "multipart"). - uploadType
string
: Legacy upload protocol for media (e.g. "media", "multipart").
- name required
Output
factchecktools.pages.update
Update for all ClaimReview
markup on a page Note that this is a full update. To retain the existing ClaimReview
markup on a page, first perform a Get operation, then modify the returned markup, and finally call Update with the entire ClaimReview
markup as the body.
google_factchecktools.factchecktools.pages.update({
"name": ""
}, context)
Input
- input
object
- name required
string
: The name of thisClaimReview
markup page resource, in the form ofpages/{page_id}
. Except for update requests, this field is output-only and should not be set by the user. - body GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage
- $.xgafv
string
(values: 1, 2): V1 error format. - access_token
string
: OAuth access token. - alt
string
(values: json, media, proto): Data format for response. - callback
string
: JSONP - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - upload_protocol
string
: Upload protocol for media (e.g. "raw", "multipart"). - uploadType
string
: Legacy upload protocol for media (e.g. "media", "multipart").
- name required
Output
Definitions
GoogleFactcheckingFactchecktoolsV1alpha1Claim
- GoogleFactcheckingFactchecktoolsV1alpha1Claim
object
: Information about the claim.- claimDate
string
: The date that the claim was made. - claimReview
array
: One or more reviews of this claim (namely, a fact-checking article). - claimant
string
: A person or organization stating the claim. For instance, "John Doe". - text
string
: The claim text. For instance, "Crime has doubled in the last 2 years."
- claimDate
GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor
- GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor
object
: Information about the claim author.- imageUrl
string
: Corresponds toClaimReview.itemReviewed.author.image
. - jobTitle
string
: Corresponds toClaimReview.itemReviewed.author.jobTitle
. - name
string
: A person or organization stating the claim. For instance, "John Doe". Corresponds toClaimReview.itemReviewed.author.name
. - sameAs
string
: Corresponds toClaimReview.itemReviewed.author.sameAs
.
- imageUrl
GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating
- GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating
object
: Information about the claim rating.- bestRating
integer
: For numeric ratings, the best value possible in the scale from worst to best. Corresponds toClaimReview.reviewRating.bestRating
. - imageUrl
string
: Corresponds toClaimReview.reviewRating.image
. - ratingExplanation
string
: Corresponds toClaimReview.reviewRating.ratingExplanation
. - ratingValue
integer
: A numeric rating of this claim, in the range worstRating — bestRating inclusive. Corresponds toClaimReview.reviewRating.ratingValue
. - textualRating
string
: The truthfulness rating as a human-readible short word or phrase. Corresponds toClaimReview.reviewRating.alternateName
. - worstRating
integer
: For numeric ratings, the worst value possible in the scale from worst to best. Corresponds toClaimReview.reviewRating.worstRating
.
- bestRating
GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview
- GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview
object
: Information about a claim review.- languageCode
string
: The language this review was written in. For instance, "en" or "de". - publisher GoogleFactcheckingFactchecktoolsV1alpha1Publisher
- reviewDate
string
: The date the claim was reviewed. - textualRating
string
: Textual rating. For instance, "Mostly false". - title
string
: The title of this claim review, if it can be determined. - url
string
: The URL of this claim review.
- languageCode
GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor
- GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor
object
: Information about the claim review author.- imageUrl
string
: Corresponds toClaimReview.author.image
. - name
string
: Name of the organization that is publishing the fact check. Corresponds toClaimReview.author.name
.
- imageUrl
GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup
- GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup
object
: Fields for an individualClaimReview
element. Except for sub-messages that group fields together, each of these fields correspond those in https://schema.org/ClaimReview. We list the precise mapping for each field.- claimAppearances
array
: A list of links to works in which this claim appears, aside from the one specified inclaim_first_appearance
. Corresponds toClaimReview.itemReviewed[@type=Claim].appearance.url
.- items
string
- items
- claimAuthor GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor
- claimDate
string
: The date when the claim was made or entered public discourse. Corresponds toClaimReview.itemReviewed.datePublished
. - claimFirstAppearance
string
: A link to a work in which this claim first appears. Corresponds toClaimReview.itemReviewed[@type=Claim].firstAppearance.url
. - claimLocation
string
: The location where this claim was made. Corresponds toClaimReview.itemReviewed.name
. - claimReviewed
string
: A short summary of the claim being evaluated. Corresponds toClaimReview.claimReviewed
. - rating GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating
- url
string
: This field is optional, and will default to the page URL. We provide this field to allow you the override the default value, but the only permitted override is the page URL plus an optional anchor link ("page jump"). Corresponds toClaimReview.url
- claimAppearances
GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage
- GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage
object
: Holds one or more instances ofClaimReview
markup for a webpage.- claimReviewAuthor GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor
- claimReviewMarkups
array
: A list of individual claim reviews for this page. Each item in the list corresponds to oneClaimReview
element. - name
string
: The name of thisClaimReview
markup page resource, in the form ofpages/{page_id}
. Except for update requests, this field is output-only and should not be set by the user. - pageUrl
string
: The URL of the page associated with thisClaimReview
markup. While every individualClaimReview
has its own URL field, semantically this is a page-level field, and eachClaimReview
on this page will use this value unless individually overridden. Corresponds toClaimReview.url
- publishDate
string
: The date when the fact check was published. Similar to the URL, semantically this is a page-level field, and eachClaimReview
on this page will contain the same value. Corresponds toClaimReview.datePublished
- versionId
string
: The version ID for this markup. Except for update requests, this field is output-only and should not be set by the user.
GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse
- GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse
object
: Response from searching fact-checked claims.- claims
array
: The list of claims and all of their associated information. - nextPageToken
string
: The next pagination token in the Search response. It should be used as thepage_token
for the following request. An empty value means no more results.
- claims
GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse
- GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse
object
: Response from listingClaimReview
markup.- claimReviewMarkupPages
array
: The result list of pages ofClaimReview
markup. - nextPageToken
string
: The next pagination token in the Search response. It should be used as thepage_token
for the following request. An empty value means no more results.
- claimReviewMarkupPages
GoogleFactcheckingFactchecktoolsV1alpha1Publisher
- GoogleFactcheckingFactchecktoolsV1alpha1Publisher
object
: Information about the publisher.- name
string
: The name of this publisher. For instance, "Awesome Fact Checks". - site
string
: Host-level site name, without the protocol or "www" prefix. For instance, "awesomefactchecks.com". This value of this field is based purely on the claim review URL.
- name
GoogleProtobufEmpty
- GoogleProtobufEmpty
object
: A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation forEmpty
is empty JSON object{}
.