Google Safe Browsing Hash List API
The HashList API from Google Safe Browsing — 1 operation(s) for hashlist.
The HashList API from Google Safe Browsing — 1 operation(s) for hashlist.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/google-safe-browsing:google-safe-browsing-hashlist-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Safe Browsing Hash List API
version: v5
description: Generated from Google's published Discovery document for Safe Browsing API (safebrowsing v5, revision 20261107). 1 operation(s).
contact:
name: Google
url: https://developers.google.com/
termsOfService: https://developers.google.com/terms
servers:
- url: https://safebrowsing.googleapis.com
tags:
- name: HashList
paths:
/v5/hashList/{name}:
get:
operationId: safebrowsing.hashList.get
summary: Get hashList
description: Gets the latest contents of a hash list. A hash list may either by a threat list or a non-threat list such as the Global Cache. This is a standard Get method as defined by https://google.aip.dev/131 and the HTTP method is also GET.
parameters:
- name: name
in: path
required: true
description: Required. The name of this particular hash list. It may be a threat list, or it may be the Global Cache.
schema:
type: string
- name: sizeConstraints.maxDatabaseEntries
in: query
required: false
description: Sets the maximum number of entries that the client is willing to have in the local database for the list. (The server MAY cause the client to store less than this number of entries.) If omitted or zero, no database size limit is set.
schema:
format: int32
type: integer
- name: sizeConstraints.maxUpdateEntries
in: query
required: false
description: The maximum size in number of entries. The update will not contain more entries than this value, but it is possible that the update will contain fewer entries than this value. This MUST be at least 1024. If omitted or zero, no update size limit is set.
schema:
format: int32
type: integer
- name: version
in: query
required: false
description: 'The version of the hash list that the client already has. If this is the first time the client is fetching the hash list, this field MUST be left empty. Otherwise, the client SHOULD supply the version previously received from the server. The client MUST NOT manipulate those bytes. **What''s new in V5**: in V4 of the API, this was called `states`; it is now renamed to `version` for clarity.'
schema:
type: string
format: byte
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleSecuritySafebrowsingV5HashList'
4XX:
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
default:
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: Error response (google.rpc.Status)
security:
- apiKey: []
tags:
- HashList
components:
schemas:
GoogleSecuritySafebrowsingV5RiceDeltaEncoded32Bit:
description: 'The Rice-Golomb encoded data. Used for either hashes or removal indices. It is guaranteed that every hash or index here has the same length, and this length is exactly 32 bits. Generally speaking, if we sort all the entries lexicographically, we will find that the higher order bits tend not to change as frequently as lower order bits. This means that if we also take the adjacent difference between entries, the higher order bits have a high probability of being zero. This exploits this high probability of zero by essentially choosing a certain number of bits; all bits more significant than this are likely to be zero so we use unary encoding. See the `rice_parameter` field. Historical note: the Rice-delta encoding was first used in V4 of this API. In V5, two significant improvements were made: firstly, the Rice-delta encoding is now available with hash prefixes longer than 4 bytes; secondly, the encoded data are now treated as big-endian so as to avoid a costly sorting step.'
properties:
encodedData:
description: The encoded deltas that are encoded using the Golomb-Rice coder.
type: string
format: byte
entriesCount:
format: int32
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`.
type: integer
riceParameter:
type: integer
description: The Golomb-Rice parameter. This parameter is guaranteed to be between 3 and 30, inclusive.
format: int32
firstValue:
description: The first entry in the encoded data (hashes or indices), or, if only a single hash prefix or index was encoded, that entry's value. If the field is empty, the entry is zero.
type: integer
format: uint32
type: object
GoogleSecuritySafebrowsingV5RiceDeltaEncoded64Bit:
properties:
entriesCount:
type: integer
format: int32
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`.
riceParameter:
format: int32
description: The Golomb-Rice parameter. This parameter is guaranteed to be between 35 and 62, inclusive.
type: integer
firstValue:
type: string
format: uint64
description: The first entry in the encoded data (hashes), or, if only a single hash prefix was encoded, that entry's value. If the field is empty, the entry is zero.
encodedData:
description: The encoded deltas that are encoded using the Golomb-Rice coder.
type: string
format: byte
description: Same as `RiceDeltaEncoded32Bit` except this encodes 64-bit numbers.
type: object
GoogleSecuritySafebrowsingV5HashList:
description: A list of hashes identified by its name.
properties:
compressedRemovals:
$ref: '#/components/schemas/GoogleSecuritySafebrowsingV5RiceDeltaEncoded32Bit'
description: The Rice-delta encoded version of removal indices. Since each hash list definitely has less than 2^32 entries, the indices are treated as 32-bit integers and encoded.
additionsThirtyTwoBytes:
$ref: '#/components/schemas/GoogleSecuritySafebrowsingV5RiceDeltaEncoded256Bit'
description: The 32-byte additions.
name:
type: string
description: The name of the hash list. Note that the Global Cache is also just a hash list and can be referred to here.
additionsSixteenBytes:
$ref: '#/components/schemas/GoogleSecuritySafebrowsingV5RiceDeltaEncoded128Bit'
description: The 16-byte additions.
additionsEightBytes:
$ref: '#/components/schemas/GoogleSecuritySafebrowsingV5RiceDeltaEncoded64Bit'
description: The 8-byte additions.
additionsFourBytes:
$ref: '#/components/schemas/GoogleSecuritySafebrowsingV5RiceDeltaEncoded32Bit'
description: The 4-byte additions.
metadata:
$ref: '#/components/schemas/GoogleSecuritySafebrowsingV5HashListMetadata'
description: Metadata about the hash list. This is not populated by the `GetHashList` method, but this is populated by the `ListHashLists` method.
partialUpdate:
description: When true, this is a partial diff containing additions and removals based on what the client already has. When false, this is the complete hash list. When false, the client MUST delete any locally stored version for this hash list. This means that either the version possessed by the client is seriously out-of-date or the client data is believed to be corrupt. The `compressed_removals` field will be empty. When true, the client MUST apply an incremental update by applying removals and then additions.
type: boolean
minimumWaitDuration:
type: string
format: google-duration
description: Clients should wait at least this long to get the hash list again. If omitted or zero, clients SHOULD fetch immediately because it indicates that the server has an additional update to be sent to the client, but could not due to the client-specified constraints.
version:
type: string
description: The version of the hash list. The client MUST NOT manipulate those bytes.
format: byte
sha256Checksum:
type: string
format: byte
description: The sorted list of all hashes, hashed again with SHA256. This is the checksum for the sorted list of all hashes present in the database after applying the provided update. In the case that no updates were provided, the server will omit this field to indicate that the client should use the existing checksum.
type: object
GoogleSecuritySafebrowsingV5RiceDeltaEncoded128Bit:
properties:
entriesCount:
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
type: integer
firstValueLo:
format: uint64
type: string
description: The lower 64 bits of the first entry in the encoded data (hashes). If the field is empty, the lower 64 bits are all zero.
encodedData:
description: The encoded deltas that are encoded using the Golomb-Rice coder.
type: string
format: byte
firstValueHi:
type: string
description: The upper 64 bits of the first entry in the encoded data (hashes). If the field is empty, the upper 64 bits are all zero.
format: uint64
riceParameter:
format: int32
type: integer
description: The Golomb-Rice parameter. This parameter is guaranteed to be between 99 and 126, inclusive.
type: object
description: Same as `RiceDeltaEncoded32Bit` except this encodes 128-bit numbers.
GoogleRpcError:
type: object
description: The error envelope every Google API returns.
properties:
error:
type: object
properties:
code:
type: integer
message:
type: string
status:
type: string
details:
type: array
items:
type: object
GoogleSecuritySafebrowsingV5HashListMetadata:
description: Metadata about a particular hash list.
type: object
properties:
likelySafeTypes:
type: array
items:
type: string
enum:
- LIKELY_SAFE_TYPE_UNSPECIFIED
- GENERAL_BROWSING
- CSD
- DOWNLOAD
description: Unordered list. If not empty, this specifies that the hash list represents a list of likely safe hashes, and this enumerates the ways they are considered likely safe. This field is mutually exclusive with the threat_types field.
description:
description: A human-readable description about this list. Written in English.
type: string
hashLength:
type: string
enum:
- HASH_LENGTH_UNSPECIFIED
- FOUR_BYTES
- EIGHT_BYTES
- SIXTEEN_BYTES
- THIRTY_TWO_BYTES
description: The supported hash length for this hash list. Each hash list will support exactly one length. If a different hash length is introduced for the same set of threat types or safe types, it will be introduced as a separate list with a distinct name and respective hash length set.
threatTypes:
description: Unordered list. If not empty, this specifies that the hash list is a kind of threat list, and this enumerates the kind of threats associated with hashes or hash prefixes in this hash list. May be empty if the entry does not represent a threat, i.e. in the case that it represents a likely safe type.
type: array
items:
type: string
enum:
- THREAT_TYPE_UNSPECIFIED
- MALWARE
- SOCIAL_ENGINEERING
- UNWANTED_SOFTWARE
- POTENTIALLY_HARMFUL_APPLICATION
GoogleSecuritySafebrowsingV5RiceDeltaEncoded256Bit:
properties:
firstValueFourthPart:
format: uint64
type: string
description: The last 64 bits of the first entry in the encoded data (hashes). If the field is empty, the last 64 bits are all zero.
entriesCount:
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:
format: byte
description: The encoded deltas that are encoded using the Golomb-Rice coder.
type: string
riceParameter:
format: int32
description: The Golomb-Rice parameter. This parameter is guaranteed to be between 227 and 254, inclusive.
type: integer
firstValueSecondPart:
type: string
format: uint64
description: The 65 through 128th bits of the first entry in the encoded data (hashes). If the field is empty, the 65 through 128th bits are all zero.
firstValueFirstPart:
description: The first 64 bits of the first entry in the encoded data (hashes). If the field is empty, the first 64 bits are all zero.
type: string
format: uint64
firstValueThirdPart:
format: uint64
type: string
description: The 129 through 192th bits of the first entry in the encoded data (hashes). If the field is empty, the 129 through 192th bits are all zero.
type: object
description: Same as `RiceDeltaEncoded32Bit` except this encodes 256-bit numbers.
securitySchemes:
apiKey:
type: apiKey
in: query
name: key
description: API key; accepted by methods that do not need user data.
externalDocs:
url: https://developers.google.com/safe-browsing/
x-provenance:
method: harvested
publisher: Google
source: https://safebrowsing.googleapis.com/$discovery/rest?version=v5
note: converted by discovery-to-openapi.py from Google's Discovery document (revision 20261107)