blob: f130ffeb21835c8b286e7e962d098ad2f162b81b [file] [log] [blame]
{
"kind": "discovery#restDescription",
"etag": "\"C5oy1hgQsABtYOYIOXWcR3BgYqU/Yoew02BLq1-_QyzwsVjtSdddocY\"",
"discoveryVersion": "v1",
"id": "safebrowsing:v4",
"name": "safebrowsing",
"version": "v4",
"revision": "20160520",
"title": "Safe Browsing APIs",
"description": "Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "https://developers.google.com/safe-browsing/",
"protocol": "rest",
"baseUrl": "https://safebrowsing.googleapis.com/",
"basePath": "",
"rootUrl": "https://safebrowsing.googleapis.com/",
"servicePath": "",
"batchPath": "batch",
"parameters": {
"access_token": {
"type": "string",
"description": "OAuth access token.",
"location": "query"
},
"alt": {
"type": "string",
"description": "Data format for response.",
"default": "json",
"enumDescriptions": [
"Responses with Content-Type of application/json",
"Media download with context-dependent Content-Type",
"Responses with Content-Type of application/x-protobuf"
],
"location": "query"
},
"bearer_token": {
"type": "string",
"description": "OAuth bearer token.",
"location": "query"
},
"callback": {
"type": "string",
"description": "JSONP",
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "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.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"pp": {
"type": "boolean",
"description": "Pretty-print response.",
"default": "true",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "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.",
"location": "query"
},
"upload_protocol": {
"type": "string",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"location": "query"
},
"uploadType": {
"type": "string",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"location": "query"
},
"$.xgafv": {
"type": "string",
"description": "V1 error format.",
"enumDescriptions": [
"v1 error format",
"v2 error format"
],
"location": "query"
}
},
"schemas": {
"FindThreatMatchesRequest": {
"id": "FindThreatMatchesRequest",
"type": "object",
"description": "Request to check entries against lists.",
"properties": {
"client": {
"$ref": "ClientInfo",
"description": "The client metadata."
},
"threatInfo": {
"$ref": "ThreatInfo",
"description": "The lists and entries to be checked for matches."
}
}
},
"ClientInfo": {
"id": "ClientInfo",
"type": "object",
"description": "The client metadata associated with Safe Browsing API requests.",
"properties": {
"clientId": {
"type": "string",
"description": "A client ID that (hopefully) uniquely identifies the client implementation of the Safe Browsing API."
},
"clientVersion": {
"type": "string",
"description": "The version of the client implementation."
}
}
},
"ThreatInfo": {
"id": "ThreatInfo",
"type": "object",
"description": "The information regarding one or more threats that a client submits when checking for matches in threat lists.",
"properties": {
"threatTypes": {
"type": "array",
"description": "The threat types to be checked.",
"enumDescriptions": [
"Unknown.",
"Malware threat type.",
"Social engineering threat type.",
"Unwanted software threat type.",
"Potentially harmful application threat type."
],
"items": {
"type": "string",
"enum": [
"THREAT_TYPE_UNSPECIFIED",
"MALWARE",
"SOCIAL_ENGINEERING",
"UNWANTED_SOFTWARE",
"POTENTIALLY_HARMFUL_APPLICATION"
]
}
},
"platformTypes": {
"type": "array",
"description": "The platform types to be checked.",
"enumDescriptions": [
"Unknown platform.",
"Threat posed to Windows.",
"Threat posed to Linux.",
"Threat posed to Android.",
"Threat posed to OS X.",
"Threat posed to iOS.",
"Threat posed to at least one of the defined platforms.",
"Threat posed to all defined platforms.",
"Threat posed to Chrome."
],
"items": {
"type": "string",
"enum": [
"PLATFORM_TYPE_UNSPECIFIED",
"WINDOWS",
"LINUX",
"ANDROID",
"OSX",
"IOS",
"ANY_PLATFORM",
"ALL_PLATFORMS",
"CHROME"
]
}
},
"threatEntryTypes": {
"type": "array",
"description": "The entry types to be checked.",
"enumDescriptions": [
"Unspecified.",
"A URL.",
"An executable program.",
"An IP range."
],
"items": {
"type": "string",
"enum": [
"THREAT_ENTRY_TYPE_UNSPECIFIED",
"URL",
"EXECUTABLE",
"IP_RANGE"
]
}
},
"threatEntries": {
"type": "array",
"description": "The threat entries to be checked.",
"items": {
"$ref": "ThreatEntry"
}
}
}
},
"ThreatEntry": {
"id": "ThreatEntry",
"type": "object",
"description": "An individual threat; for example, a malicious URL or its hash representation. Only one of these fields should be set.",
"properties": {
"hash": {
"type": "string",
"description": "A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. This field is in binary format.",
"format": "byte"
},
"url": {
"type": "string",
"description": "A URL."
},
"digest": {
"type": "string",
"description": "The digest of an executable in SHA256 format. The API supports both binary and hex digests.",
"format": "byte"
}
}
},
"FindThreatMatchesResponse": {
"id": "FindThreatMatchesResponse",
"type": "object",
"properties": {
"matches": {
"type": "array",
"description": "The threat list matches.",
"items": {
"$ref": "ThreatMatch"
}
}
}
},
"ThreatMatch": {
"id": "ThreatMatch",
"type": "object",
"description": "A match when checking a threat entry in the Safe Browsing threat lists.",
"properties": {
"threatType": {
"type": "string",
"description": "The threat type matching this threat.",
"enum": [
"THREAT_TYPE_UNSPECIFIED",
"MALWARE",
"SOCIAL_ENGINEERING",
"UNWANTED_SOFTWARE",
"POTENTIALLY_HARMFUL_APPLICATION"
]
},
"platformType": {
"type": "string",
"description": "The platform type matching this threat.",
"enum": [
"PLATFORM_TYPE_UNSPECIFIED",
"WINDOWS",
"LINUX",
"ANDROID",
"OSX",
"IOS",
"ANY_PLATFORM",
"ALL_PLATFORMS",
"CHROME"
]
},
"threatEntryType": {
"type": "string",
"description": "The threat entry type matching this threat.",
"enum": [
"THREAT_ENTRY_TYPE_UNSPECIFIED",
"URL",
"EXECUTABLE",
"IP_RANGE"
]
},
"threat": {
"$ref": "ThreatEntry",
"description": "The threat matching this threat."
},
"threatEntryMetadata": {
"$ref": "ThreatEntryMetadata",
"description": "Optional metadata associated with this threat."
},
"cacheDuration": {
"type": "string",
"description": "The cache lifetime for the returned match. Clients must not cache this response for more than this duration to avoid false positives."
}
}
},
"ThreatEntryMetadata": {
"id": "ThreatEntryMetadata",
"type": "object",
"description": "The metadata associated with a specific threat entry. The client is expected to know the metadata key/value pairs associated with each threat type.",
"properties": {
"entries": {
"type": "array",
"description": "The metadata entries.",
"items": {
"$ref": "MetadataEntry"
}
}
}
},
"MetadataEntry": {
"id": "MetadataEntry",
"type": "object",
"description": "A single metadata entry.",
"properties": {
"key": {
"type": "string",
"description": "The metadata entry key.",
"format": "byte"
},
"value": {
"type": "string",
"description": "The metadata entry value.",
"format": "byte"
}
}
},
"FetchThreatListUpdatesRequest": {
"id": "FetchThreatListUpdatesRequest",
"type": "object",
"description": "Describes a Safe Browsing API update request. Clients can request updates for multiple lists in a single request. NOTE: Field index 2 is unused. NEXT: 4",
"properties": {
"client": {
"$ref": "ClientInfo",
"description": "The client metadata."
},
"listUpdateRequests": {
"type": "array",
"description": "The requested threat list updates.",
"items": {
"$ref": "ListUpdateRequest"
}
}
}
},
"ListUpdateRequest": {
"id": "ListUpdateRequest",
"type": "object",
"description": "A single list update request.",
"properties": {
"threatType": {
"type": "string",
"description": "The type of threat posed by entries present in the list.",
"enum": [
"THREAT_TYPE_UNSPECIFIED",
"MALWARE",
"SOCIAL_ENGINEERING",
"UNWANTED_SOFTWARE",
"POTENTIALLY_HARMFUL_APPLICATION"
]
},
"platformType": {
"type": "string",
"description": "The type of platform at risk by entries present in the list.",
"enum": [
"PLATFORM_TYPE_UNSPECIFIED",
"WINDOWS",
"LINUX",
"ANDROID",
"OSX",
"IOS",
"ANY_PLATFORM",
"ALL_PLATFORMS",
"CHROME"
]
},
"threatEntryType": {
"type": "string",
"description": "The types of entries present in the list.",
"enum": [
"THREAT_ENTRY_TYPE_UNSPECIFIED",
"URL",
"EXECUTABLE",
"IP_RANGE"
]
},
"state": {
"type": "string",
"description": "The current state of the client for the requested list (the encrypted client state that was received from the last successful list update).",
"format": "byte"
},
"constraints": {
"$ref": "Constraints",
"description": "The constraints associated with this request."
}
}
},
"Constraints": {
"id": "Constraints",
"type": "object",
"description": "The constraints for this update.",
"properties": {
"maxUpdateEntries": {
"type": "integer",
"description": "The maximum size in number of entries. The update will not contain more entries than this value. This should be a power of 2 between 2**10 and 2**20. If zero, no update size limit is set.",
"format": "int32"
},
"maxDatabaseEntries": {
"type": "integer",
"description": "Sets the maximum number of entries that the client is willing to have in the local database. This should be a power of 2 between 2**10 and 2**20. If zero, no database size limit is set.",
"format": "int32"
},
"region": {
"type": "string",
"description": "Requests the list for a specific geographic location. If not set the server may pick that value based on the user's IP address. Expects ISO 3166-1 alpha-2 format."
},
"supportedCompressions": {
"type": "array",
"description": "The compression types supported by the client.",
"enumDescriptions": [
"Unknown.",
"Raw, uncompressed data.",
"Rice-Golomb encoded data."
],
"items": {
"type": "string",
"enum": [
"COMPRESSION_TYPE_UNSPECIFIED",
"RAW",
"RICE"
]
}
}
}
},
"FetchThreatListUpdatesResponse": {
"id": "FetchThreatListUpdatesResponse",
"type": "object",
"properties": {
"listUpdateResponses": {
"type": "array",
"description": "The list updates requested by the clients.",
"items": {
"$ref": "ListUpdateResponse"
}
},
"minimumWaitDuration": {
"type": "string",
"description": "The minimum duration the client must wait before issuing any update request. If this field is not set clients may update as soon as they want."
}
}
},
"ListUpdateResponse": {
"id": "ListUpdateResponse",
"type": "object",
"description": "An update to an individual list.",
"properties": {
"threatType": {
"type": "string",
"description": "The threat type for which data is returned.",
"enum": [
"THREAT_TYPE_UNSPECIFIED",
"MALWARE",
"SOCIAL_ENGINEERING",
"UNWANTED_SOFTWARE",
"POTENTIALLY_HARMFUL_APPLICATION"
]
},
"threatEntryType": {
"type": "string",
"description": "The format of the threats.",
"enum": [
"THREAT_ENTRY_TYPE_UNSPECIFIED",
"URL",
"EXECUTABLE",
"IP_RANGE"
]
},
"platformType": {
"type": "string",
"description": "The platform type for which data is returned.",
"enum": [
"PLATFORM_TYPE_UNSPECIFIED",
"WINDOWS",
"LINUX",
"ANDROID",
"OSX",
"IOS",
"ANY_PLATFORM",
"ALL_PLATFORMS",
"CHROME"
]
},
"responseType": {
"type": "string",
"description": "The type of response. This may indicate that an action is required by the client when the response is received.",
"enum": [
"RESPONSE_TYPE_UNSPECIFIED",
"PARTIAL_UPDATE",
"FULL_UPDATE"
]
},
"additions": {
"type": "array",
"description": "A set of entries to add to a local threat type's list. Repeated to allow for a combination of compressed and raw data to be sent in a single response.",
"items": {
"$ref": "ThreatEntrySet"
}
},
"removals": {
"type": "array",
"description": "A set of entries to remove from a local threat type's list. Repeated for the same reason as above.",
"items": {
"$ref": "ThreatEntrySet"
}
},
"newClientState": {
"type": "string",
"description": "The new client state, in encrypted format. Opaque to clients.",
"format": "byte"
},
"checksum": {
"$ref": "Checksum",
"description": "The expected SHA256 hash of the client state; that is, of the sorted list of all hashes present in the database after applying the provided update. If the client state doesn't match the expected state, the client must disregard this update and retry later."
}
}
},
"ThreatEntrySet": {
"id": "ThreatEntrySet",
"type": "object",
"description": "A set of threats that should be added or removed from a client's local database.",
"properties": {
"compressionType": {
"type": "string",
"description": "The compression type for the entries in this set.",
"enum": [
"COMPRESSION_TYPE_UNSPECIFIED",
"RAW",
"RICE"
]
},
"rawHashes": {
"$ref": "RawHashes",
"description": "The raw SHA256-formatted entries."
},
"rawIndices": {
"$ref": "RawIndices",
"description": "The raw removal indices for a local list."
},
"riceHashes": {
"$ref": "RiceDeltaEncoding",
"description": "The encoded 4-byte prefixes of SHA256-formatted entries, using a Golomb-Rice encoding."
},
"riceIndices": {
"$ref": "RiceDeltaEncoding",
"description": "The encoded local, lexicographically-sorted list indices, using a Golomb-Rice encoding. Used for sending compressed removal indices."
}
}
},
"RawHashes": {
"id": "RawHashes",
"type": "object",
"description": "The uncompressed threat entries in hash format of a particular prefix length. Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 bytes, but some hashes are lengthened if they collide with the hash of a popular URL. Used for sending ThreatEntrySet to clients that do not support compression, or when sending non-4-byte hashes to clients that do support compression.",
"properties": {
"prefixSize": {
"type": "integer",
"description": "The number of bytes for each prefix encoded below. This field can be anywhere from 4 (shortest prefix) to 32 (full SHA256 hash).",
"format": "int32"
},
"rawHashes": {
"type": "string",
"description": "The hashes, all concatenated into one long string. Each hash has a prefix size of |prefix_size| above. Hashes are sorted in lexicographic order.",
"format": "byte"
}
}
},
"RawIndices": {
"id": "RawIndices",
"type": "object",
"description": "A set of raw indices to remove from a local list.",
"properties": {
"indices": {
"type": "array",
"description": "The indices to remove from a lexicographically-sorted local list.",
"items": {
"type": "integer",
"format": "int32"
}
}
}
},
"RiceDeltaEncoding": {
"id": "RiceDeltaEncoding",
"type": "object",
"description": "The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or compressed removal indices.",
"properties": {
"firstValue": {
"type": "string",
"description": "The offset of the first entry in the encoded data, or, if only a single integer was encoded, that single integer's value.",
"format": "int64"
},
"riceParameter": {
"type": "integer",
"description": "The Golomb-Rice parameter, which is a number between 2 and 28. This field is missing (that is, zero) if `num_entries` is zero.",
"format": "int32"
},
"numEntries": {
"type": "integer",
"description": "The number of entries that are delta encoded in the encoded data. If only a single integer was encoded, this will be zero and the single value will be stored in `first_value`.",
"format": "int32"
},
"encodedData": {
"type": "string",
"description": "The encoded deltas that are encoded using the Golomb-Rice coder.",
"format": "byte"
}
}
},
"Checksum": {
"id": "Checksum",
"type": "object",
"description": "The expected state of a client's local database.",
"properties": {
"sha256": {
"type": "string",
"description": "The SHA256 hash of the client state; that is, of the sorted list of all hashes present in the database.",
"format": "byte"
}
}
},
"FindFullHashesRequest": {
"id": "FindFullHashesRequest",
"type": "object",
"description": "Request to return full hashes matched by the provided hash prefixes.",
"properties": {
"client": {
"$ref": "ClientInfo",
"description": "The client metadata."
},
"clientStates": {
"type": "array",
"description": "The current client states for each of the client's local threat lists.",
"items": {
"type": "string",
"format": "byte"
}
},
"threatInfo": {
"$ref": "ThreatInfo",
"description": "The lists and hashes to be checked."
}
}
},
"FindFullHashesResponse": {
"id": "FindFullHashesResponse",
"type": "object",
"properties": {
"matches": {
"type": "array",
"description": "The full hashes that matched the requested prefixes.",
"items": {
"$ref": "ThreatMatch"
}
},
"minimumWaitDuration": {
"type": "string",
"description": "The minimum duration the client must wait before issuing any find hashes request. If this field is not set, clients can issue a request as soon as they want."
},
"negativeCacheDuration": {
"type": "string",
"description": "For requested entities that did not match the threat list, how long to cache the response."
}
}
},
"ListThreatListsResponse": {
"id": "ListThreatListsResponse",
"type": "object",
"properties": {
"threatLists": {
"type": "array",
"description": "The lists available for download by the client.",
"items": {
"$ref": "ThreatListDescriptor"
}
}
}
},
"ThreatListDescriptor": {
"id": "ThreatListDescriptor",
"type": "object",
"description": "Describes an individual threat list. A list is defined by three parameters: the type of threat posed, the type of platform targeted by the threat, and the type of entries in the list.",
"properties": {
"threatType": {
"type": "string",
"description": "The threat type posed by the list's entries.",
"enum": [
"THREAT_TYPE_UNSPECIFIED",
"MALWARE",
"SOCIAL_ENGINEERING",
"UNWANTED_SOFTWARE",
"POTENTIALLY_HARMFUL_APPLICATION"
]
},
"platformType": {
"type": "string",
"description": "The platform type targeted by the list's entries.",
"enum": [
"PLATFORM_TYPE_UNSPECIFIED",
"WINDOWS",
"LINUX",
"ANDROID",
"OSX",
"IOS",
"ANY_PLATFORM",
"ALL_PLATFORMS",
"CHROME"
]
},
"threatEntryType": {
"type": "string",
"description": "The entry types contained in the list.",
"enum": [
"THREAT_ENTRY_TYPE_UNSPECIFIED",
"URL",
"EXECUTABLE",
"IP_RANGE"
]
}
}
}
},
"resources": {
"threatMatches": {
"methods": {
"find": {
"id": "safebrowsing.threatMatches.find",
"path": "v4/threatMatches:find",
"httpMethod": "POST",
"description": "Finds the threat entries that match the Safe Browsing lists.",
"request": {
"$ref": "FindThreatMatchesRequest"
},
"response": {
"$ref": "FindThreatMatchesResponse"
}
}
}
},
"threatListUpdates": {
"methods": {
"fetch": {
"id": "safebrowsing.threatListUpdates.fetch",
"path": "v4/threatListUpdates:fetch",
"httpMethod": "POST",
"description": "Fetches the most recent threat list updates. A client can request updates for multiple lists at once.",
"request": {
"$ref": "FetchThreatListUpdatesRequest"
},
"response": {
"$ref": "FetchThreatListUpdatesResponse"
}
}
}
},
"fullHashes": {
"methods": {
"find": {
"id": "safebrowsing.fullHashes.find",
"path": "v4/fullHashes:find",
"httpMethod": "POST",
"description": "Finds the full hashes that match the requested hash prefixes.",
"request": {
"$ref": "FindFullHashesRequest"
},
"response": {
"$ref": "FindFullHashesResponse"
}
}
}
},
"threatLists": {
"methods": {
"list": {
"id": "safebrowsing.threatLists.list",
"path": "v4/threatLists",
"httpMethod": "GET",
"description": "Lists the Safe Browsing threat lists available for download.",
"response": {
"$ref": "ListThreatListsResponse"
}
}
}
}
}
}