Method: hashLists.batchGet
Stay organized with collections
Save and categorize content based on your preferences.
Get multiple hash lists at once.
It is very common for a client to need to get multiple hash lists. Using this method is preferred over using the regular Get method multiple times.
This is a standard batch Get method as defined by https://google.aip.dev/231 and the HTTP method is also GET.
HTTP request
GET https://safebrowsing.googleapis.com/v5alpha1/hashLists:batchGet
The URL uses gRPC Transcoding syntax.
Query parameters
Parameters |
names[] |
string
Required. The names of the particular hash lists. The list MAY be a threat list, or it may be the Global Cache. The names MUST NOT contain duplicates; if they did, the client will get an error.
|
version[] |
string (bytes format)
The versions of the hash list that the client already has. If this is the first time the client is fetching the hash lists, the field should be left empty. Otherwise, the client should supply the versions previously received from the server. The client MUST NOT manipulate those bytes. The client need not send the versions in the same order as the corresponding list names. The client may send fewer or more versions in a request than there are names. However the client MUST NOT send multiple versions that correspond to the same name; if it did, the client will get an error. Historical note: in V4 of the API, this was called states ; it is now renamed to version for clarity. A base64-encoded string.
|
sizeConstraints |
object (SizeConstraints )
The size constraints on each list. If omitted, there are no constraints. Note that the sizes here are per-list, not aggregated across all lists.
|
Request body
The request body must be empty.
Response body
The response containing multiple hash lists.
If successful, the response body contains data with the following structure:
JSON representation |
{
"hashLists": [
{
object (HashList )
}
]
} |
Fields |
hashLists[] |
object (HashList )
The hash lists in the same order given in the request.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-23 UTC.
[null,null,["Last updated 2025-05-23 UTC."],[[["\u003cp\u003eBatch retrieve multiple hash lists efficiently, rather than using individual Get requests.\u003c/p\u003e\n"],["\u003cp\u003eSpecify desired hash lists by name, versions (if previously fetched), desired hash prefix length, and optionally, size constraints.\u003c/p\u003e\n"],["\u003cp\u003eReceive a response containing the requested hash lists in the specified order.\u003c/p\u003e\n"],["\u003cp\u003eThis method adheres to the standard batch Get method as defined by Google AIP and uses the GET HTTP method.\u003c/p\u003e\n"],["\u003cp\u003eRequest body should be empty for this operation.\u003c/p\u003e\n"]]],["This document details the `batchGet` method for retrieving multiple hash lists via a `GET` HTTP request to `safebrowsing.googleapis.com/v5alpha1/hashLists:batchGet`. Required parameters include `names[]` for specifying hash lists and `version[]` for indicating existing versions. `desiredHashLength` defines the desired hash prefix length, and `sizeConstraints` limits list sizes. The request body is empty, and the response contains an array `hashLists[]`, ordered as requested.\n"],null,["# Method: hashLists.batchGet\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.BatchGetHashListsResponse.SCHEMA_REPRESENTATION)\n\nGet multiple hash lists at once.\n\nIt is very common for a client to need to get multiple hash lists. Using this method is preferred over using the regular Get method multiple times.\n\nThis is a standard batch Get method as defined by \u003chttps://google.aip.dev/231\u003e and the HTTP method is also GET.\n\n### HTTP request\n\n`GET https://safebrowsing.googleapis.com/v5alpha1/hashLists:batchGet`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `names[]` | `string` Required. The names of the particular hash lists. The list MAY be a threat list, or it may be the Global Cache. The names MUST NOT contain duplicates; if they did, the client will get an error. |\n| `version[]` | `string (`[bytes](https://developers.google.com/discovery/v1/type-format)` format)` The versions of the hash list that the client already has. If this is the first time the client is fetching the hash lists, the field should be left empty. Otherwise, the client should supply the versions previously received from the server. The client MUST NOT manipulate those bytes. The client need not send the versions in the same order as the corresponding list names. The client may send fewer or more versions in a request than there are names. However the client MUST NOT send multiple versions that correspond to the same name; if it did, the client will get an error. Historical note: in V4 of the API, this was called `states`; it is now renamed to `version` for clarity. A base64-encoded string. |\n| `sizeConstraints` | `object (`[SizeConstraints](/safe-browsing/reference/rest/v5alpha1/SizeConstraints)`)` The size constraints on each list. If omitted, there are no constraints. Note that the sizes here are per-list, not aggregated across all lists. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nThe response containing multiple hash lists.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------|\n| ``` { \"hashLists\": [ { object (/safe-browsing/reference/rest/v5alpha1/hashList#HashList) } ] } ``` |\n\n| Fields ||\n|---------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| `hashLists[]` | `object (`[HashList](/safe-browsing/reference/rest/v5alpha1/hashList#HashList)`)` The hash lists in the same order given in the request. |"]]