Google Safe Browsing Hashes API

The Hashes API from Google Safe Browsing — 2 operation(s) for hashes.

GitHub OpenAPI

Operations 2

GET /v5/hashes:search Search hashes #
GET /v1/hashes:search Search hashes #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/google-safe-browsing:google-safe-browsing-hashes-api"
All apis
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.

Get an API 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 Specification

google-safe-browsing-hashes-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Google Safe Browsing Hashes API
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
  version: '1.0'
  description: 'Operations tagged Hashes across 2 of this provider''s published API definitions: google-safe-browsing-safebrowsing-hashes-api-openapi.yml, google-safe-browsing-webrisk-hashes-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://safebrowsing.googleapis.com
- url: https://webrisk.googleapis.com
tags:
- name: Hashes
paths:
  /v5/hashes:search:
    get:
      operationId: safebrowsing.hashes.search
      summary: Search hashes
      description: Searches for full hashes matching the specified prefixes. This is a custom method as defined by https://google.aip.dev/136 (the custom method refers to this method having a custom name within Google's general API development nomenclature; it does not refer to using a custom HTTP method).
      parameters:
      - name: hashPrefixes
        in: query
        required: false
        description: Required. The hash prefixes to be looked up. Clients MUST NOT send more than 1000 hash prefixes. However, following the URL processing procedure, clients SHOULD NOT need to send more than 30 hash prefixes. Currently each hash prefix is required to be exactly 4 bytes long. This MAY be relaxed in the future.
        schema:
          type: array
          items:
            type: string
            format: byte
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleSecuritySafebrowsingV5SearchHashesResponse'
        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:
      - Hashes
    servers:
    - url: https://safebrowsing.googleapis.com
  /v1/hashes:search:
    get:
      operationId: webrisk.hashes.search
      summary: Search hashes
      description: Gets the full hashes that match the requested hash prefix. This is used after a hash prefix is looked up in a threatList and there is a match. The client side threatList only holds partial hashes so the client must query this method to determine if there is a full hash match of a threat.
      parameters:
      - name: hashPrefix
        in: query
        required: false
        description: A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. For JSON requests, this field is base64-encoded. Note that if this parameter is provided by a URI, it must be encoded using the web safe base64 variant (RFC 4648).
        schema:
          format: byte
          type: string
      - name: threatTypes
        in: query
        required: false
        description: Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
        schema:
          type: array
          items:
            enum:
            - THREAT_TYPE_UNSPECIFIED
            - MALWARE
            - SOCIAL_ENGINEERING
            - UNWANTED_SOFTWARE
            - SOCIAL_ENGINEERING_EXTENDED_COVERAGE
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleCloudWebriskV1SearchHashesResponse'
        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:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
      - apiKey: []
      tags:
      - Hashes
    servers:
    - url: https://webrisk.googleapis.com
components:
  schemas:
    GoogleSecuritySafebrowsingV5SearchHashesResponse:
      properties:
        fullHashes:
          type: array
          description: Unordered list. The unordered list of full hashes found.
          items:
            $ref: '#/components/schemas/GoogleSecuritySafebrowsingV5FullHash'
        cacheDuration:
          format: google-duration
          type: string
          description: 'The client-side cache duration. The client MUST add this duration to the current time to determine the expiration time. The expiration time then applies to every hash prefix queried by the client in the request, regardless of how many full hashes are returned in the response. Even if the server returns no full hashes for a particular hash prefix, this fact MUST also be cached by the client. If and only if the field `full_hashes` is empty, the client MAY increase the `cache_duration` to determine a new expiration that is later than that specified by the server. In any case, the increased cache duration must not be longer than 24 hours. Important: the client MUST NOT assume that the server will return the same cache duration for all responses. The server MAY choose different cache durations for different responses depending on the situation.'
      description: 'The response returned after searching threat hashes. If nothing is found, the server will return an OK status (HTTP status code 200) with the `full_hashes` field empty, rather than returning a NOT_FOUND status (HTTP status code 404). **What''s new in V5**: There is a separation between `FullHash` and `FullHashDetail`. In the case when a hash represents a site having multiple threats (e.g. both MALWARE and SOCIAL_ENGINEERING), the full hash does not need to be sent twice as in V4. Furthermore, the cache duration has been simplified into a single `cache_duration` field.'
      type: object
    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
    GoogleSecuritySafebrowsingV5FullHash:
      description: The full hash identified with one or more matches.
      properties:
        fullHash:
          description: The matching full hash. This is the SHA256 hash. The length will be exactly 32 bytes.
          format: byte
          type: string
        fullHashDetails:
          items:
            $ref: '#/components/schemas/GoogleSecuritySafebrowsingV5FullHashFullHashDetail'
          type: array
          description: Unordered list. A repeated field identifying the details relevant to this full hash.
      type: object
    GoogleSecuritySafebrowsingV5FullHashFullHashDetail:
      description: 'Details about a matching full hash. An important note about forward compatibility: new threat types and threat attributes may be added by the server at any time; those additions are considered minor version changes. It is Google''s policy not to expose minor version numbers in APIs (see https://cloud.google.com/apis/design/versioning for the versioning policy), so clients MUST be prepared to receive `FullHashDetail` messages containing `ThreatType` enum values or `ThreatAttribute` enum values that are considered invalid by the client. Therefore, it is the client''s responsibility to check for the validity of all `ThreatType` and `ThreatAttribute` enum values; if any value is considered invalid, the client MUST disregard the entire `FullHashDetail` message.'
      type: object
      properties:
        attributes:
          description: Unordered list. Additional attributes about those full hashes. This may be empty.
          items:
            type: string
            enum:
            - THREAT_ATTRIBUTE_UNSPECIFIED
            - CANARY
            - FRAME_ONLY
          type: array
        threatType:
          type: string
          enum:
          - THREAT_TYPE_UNSPECIFIED
          - MALWARE
          - SOCIAL_ENGINEERING
          - UNWANTED_SOFTWARE
          - POTENTIALLY_HARMFUL_APPLICATION
          description: The type of threat. This field will never be empty.
    GoogleCloudWebriskV1SearchHashesResponse:
      type: object
      properties:
        threats:
          items:
            $ref: '#/components/schemas/GoogleCloudWebriskV1SearchHashesResponseThreatHash'
          description: The full hashes that matched the requested prefixes. The hash will be populated in the key.
          type: array
        negativeExpireTime:
          format: google-datetime
          description: For requested entities that did not match the threat list, how long to cache the response until.
          type: string
    GoogleCloudWebriskV1SearchHashesResponseThreatHash:
      type: object
      properties:
        expireTime:
          type: string
          format: google-datetime
          description: The cache lifetime for the returned match. Clients must not cache this response past this timestamp to avoid false positives.
        threatTypes:
          description: The ThreatList this threat belongs to. This must contain at least one entry.
          items:
            type: string
            enum:
            - THREAT_TYPE_UNSPECIFIED
            - MALWARE
            - SOCIAL_ENGINEERING
            - UNWANTED_SOFTWARE
            - SOCIAL_ENGINEERING_EXTENDED_COVERAGE
          type: array
        hash:
          format: byte
          description: A 32 byte SHA256 hash. This field is in binary format. For JSON requests, hashes are base64-encoded.
          type: string
      description: Contains threat information on a matching hash.
  securitySchemes:
    apiKey:
      type: apiKey
      in: query
      name: key
      description: API key; accepted by methods that do not need user data.
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/cloud-platform: See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
x-refined-from:
- google-safe-browsing-safebrowsing-hashes-api-openapi.yml
- google-safe-browsing-webrisk-hashes-api-openapi.yml
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)