Google Safe Browsing Threat Lists API

The ThreatLists API from Google Safe Browsing — 1 operation(s) for threatlists.

GitHub OpenAPI

Operations 1

GET /v1/threatLists:computeDiff Compute diff threatLists #

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-threatlists-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-threatlists-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Web Risk Threat Lists API
  version: v1
  description: Generated from Google's published Discovery document for Web Risk API (webrisk v1, revision 20261106). 1 operation(s).
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
servers:
- url: https://webrisk.googleapis.com
tags:
- name: ThreatLists
paths:
  /v1/threatLists:computeDiff:
    get:
      operationId: webrisk.threatLists.computeDiff
      summary: Compute diff threatLists
      description: Gets the most recent threat list diffs. These diffs should be applied to a local database of hashes to keep it up-to-date. If the local database is empty or excessively out-of-date, a complete snapshot of the database will be returned. This Method only updates a single ThreatList at a time. To update multiple ThreatList databases, this method needs to be called once for each list.
      parameters:
      - name: constraints.maxDatabaseEntries
        in: query
        required: false
        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.
        schema:
          format: int32
          type: integer
      - name: constraints.maxDiffEntries
        in: query
        required: false
        description: The maximum size in number of entries. The diff will not contain more entries than this value. This should be a power of 2 between 2**10 and 2**20. If zero, no diff size limit is set.
        schema:
          type: integer
          format: int32
      - name: constraints.supportedCompressions
        in: query
        required: false
        description: The compression types supported by the client.
        schema:
          type: array
          items:
            enum:
            - COMPRESSION_TYPE_UNSPECIFIED
            - RAW
            - RICE
            type: string
      - name: threatType
        in: query
        required: false
        description: Required. The threat list to update. Only a single ThreatType should be specified per request. If you want to handle multiple ThreatTypes, you must make one request per ThreatType.
        schema:
          enum:
          - THREAT_TYPE_UNSPECIFIED
          - MALWARE
          - SOCIAL_ENGINEERING
          - UNWANTED_SOFTWARE
          - SOCIAL_ENGINEERING_EXTENDED_COVERAGE
          type: string
      - name: versionToken
        in: query
        required: false
        description: The current version token of the client for the requested list (the client version that was received from the last successful diff). If the client does not have a version token (this is the first time calling ComputeThreatListDiff), this may be left empty and a full database snapshot will be returned.
        schema:
          format: byte
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleCloudWebriskV1ComputeThreatListDiffResponse'
        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:
      - ThreatLists
components:
  schemas:
    GoogleCloudWebriskV1RawHashes:
      type: object
      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). In practice this is almost always 4, except in exceptional circumstances.
          format: int32
        rawHashes:
          format: byte
          description: The hashes, in binary format, concatenated into one long string. Hashes are sorted in lexicographic order. For JSON API users, hashes are base64-encoded.
          type: string
      description: The uncompressed threat entries in hash format. 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 URI. Used for sending ThreatEntryAdditons to clients that do not support compression, or when sending non-4-byte hashes to clients that do support compression.
    GoogleCloudWebriskV1ComputeThreatListDiffResponseChecksum:
      properties:
        sha256:
          description: The SHA256 hash of the client state; that is, of the sorted list of all hashes present in the database.
          type: string
          format: byte
      description: The expected state of a client's local database.
      type: object
    GoogleCloudWebriskV1RawIndices:
      properties:
        indices:
          description: The indices to remove from a lexicographically-sorted local list.
          items:
            type: integer
            format: int32
          type: array
      type: object
      description: A set of raw indices to remove from a local list.
    GoogleCloudWebriskV1RiceDeltaEncoding:
      properties:
        riceParameter:
          format: int32
          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.
        encodedData:
          description: The encoded deltas that are encoded using the Golomb-Rice coder.
          type: string
          format: byte
        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. If the field is empty or missing, assume zero.
          format: int64
        entryCount:
          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`.
      description: The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or compressed removal indices.
      type: object
    GoogleCloudWebriskV1ThreatEntryAdditions:
      properties:
        rawHashes:
          type: array
          items:
            $ref: '#/components/schemas/GoogleCloudWebriskV1RawHashes'
          description: The raw SHA256-formatted entries. Repeated to allow returning sets of hashes with different prefix sizes.
        riceHashes:
          $ref: '#/components/schemas/GoogleCloudWebriskV1RiceDeltaEncoding'
          description: The encoded 4-byte prefixes of SHA256-formatted entries, using a Golomb-Rice encoding. The hashes are converted to uint32, sorted in ascending order, then delta encoded and stored as encoded_data.
      description: Contains the set of entries to add to a local database. May contain a combination of compressed and raw data in a single response.
      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
    GoogleCloudWebriskV1ComputeThreatListDiffResponse:
      type: object
      properties:
        recommendedNextDiff:
          type: string
          format: google-datetime
          description: The soonest the client should wait before issuing any diff request. Querying sooner is unlikely to produce a meaningful diff. Waiting longer is acceptable considering the use case. If this field is not set clients may update as soon as they want.
        removals:
          $ref: '#/components/schemas/GoogleCloudWebriskV1ThreatEntryRemovals'
          description: A set of entries to remove from a local threat type's list. This field may be empty.
        responseType:
          enum:
          - RESPONSE_TYPE_UNSPECIFIED
          - DIFF
          - RESET
          description: The type of response. This may indicate that an action must be taken by the client when the response is received.
          type: string
        newVersionToken:
          format: byte
          type: string
          description: The new opaque client version token. This should be retained by the client and passed into the next call of ComputeThreatListDiff as 'version_token'. A separate version token should be stored and used for each threatList.
        checksum:
          $ref: '#/components/schemas/GoogleCloudWebriskV1ComputeThreatListDiffResponseChecksum'
          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 diff. If the client state doesn't match the expected state, the client must discard this diff and retry later.
        additions:
          $ref: '#/components/schemas/GoogleCloudWebriskV1ThreatEntryAdditions'
          description: A set of entries to add to a local threat type's list.
    GoogleCloudWebriskV1ThreatEntryRemovals:
      type: object
      properties:
        rawIndices:
          $ref: '#/components/schemas/GoogleCloudWebriskV1RawIndices'
          description: The raw removal indices for a local list.
        riceIndices:
          $ref: '#/components/schemas/GoogleCloudWebriskV1RiceDeltaEncoding'
          description: The encoded local, lexicographically-sorted list indices, using a Golomb-Rice encoding. Used for sending compressed removal indices. The removal indices (uint32) are sorted in ascending order, then delta encoded and stored as encoded_data.
      description: Contains the set of entries to remove from a local database.
  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.
externalDocs:
  url: https://cloud.google.com/web-risk/
x-provenance:
  method: harvested
  publisher: Google
  source: https://webrisk.googleapis.com/$discovery/rest?version=v1
  note: converted by discovery-to-openapi.py from Google's Discovery document (revision 20261106)