开始使用
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
基本设置
如果您使用的是 Lookup API 或 Update API,
您需要拥有 Google 账号、Google Developer Console 项目和 API 密钥。您还需要
激活 Safe Browsing API 以供您的项目使用。
如果您在执行下述步骤时需要其他帮助,请查看
<ph type="x-smartling-placeholder"></ph>
Google API 控制台帮助中心。
1. 创建账号
您需要有 Google 账号才能创建项目。如果您还没有账号,
创建您的 Google 账号页面即可注册。
2. 创建项目
您需要有一个 Google Developer Console 项目,才能创建 API 密钥。如果您
已有项目,请参阅
<ph type="x-smartling-placeholder"></ph>
创建、关停和恢复项目。
3. 设置 API 密钥
您需要 API 密钥才能访问安全浏览 API。API 密钥用于验证您
API 用户,并允许您与 API 进行交互。您将此密钥作为网址参数传入
向安全浏览服务器发送 HTTP 请求例如,将您的 API 密钥替换为
此处显示的是 API_KEY
:
https://safebrowsing.googleapis.com/v4/...?key=API_KEY
如需设置 API 密钥,请参阅
<ph type="x-smartling-placeholder"></ph>
设置 API 密钥。
您的新 API 密钥随即会显示在表格中,请根据需要复制并粘贴此密钥。
4. 激活 API
最后,您需要激活 Safe Browsing API 以用于您的项目。学习内容
操作方法,请参见
<ph type="x-smartling-placeholder"></ph>
启用和停用 API。要启用的 API 称为“安全浏览 API”。
数据库设置
如果您使用的是 Update API,则还需要设置本地数据库。
安全浏览功能提供了一个 Go 软件包,供您快速上手。
有关更多信息,请参阅 数据库设置 部分
本地数据库。
使用 API
在开始之前,请阅读我们的服务条款和
价格指南。此外,请查看并确保您了解
安全浏览 API 的使用限制。
若要开始使用安全浏览 API,请参阅以下指南:
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eTo use the Safe Browsing Lookup or Update API, you need a Google Account, a Google Developer Console project, an API key, and activated Safe Browsing APIs.\u003c/p\u003e\n"],["\u003cp\u003eSetting up involves creating an account and project, obtaining an API key via the Google Developer Console, and activating the "Safe Browsing APIs" for your project.\u003c/p\u003e\n"],["\u003cp\u003eThe Update API requires a local database setup using provided tools and guidance.\u003c/p\u003e\n"],["\u003cp\u003eBefore using the APIs, review the Terms of Service, Pricing, and Usage Limits for compliance and understanding.\u003c/p\u003e\n"],["\u003cp\u003eDetailed guides are available for utilizing the Lookup API (v4) and Update API (v4).\u003c/p\u003e\n"]]],["To use the Safe Browsing APIs, you need a Google Account, a Developer Console project, and an API key. First, create a Google Account and a Developer Console project. Then, set up an API key for authentication and copy it for use in HTTP requests. Finally, activate the \"Safe Browsing APIs\" for your project. Update API users must also set up a local database, referencing the provided guide. Always review the Terms of Service, Pricing, and Usage Limits.\n"],null,["# Get started\n\nGeneral setup\n-------------\n\nIf you are using the Lookup API or the Update API you\nneed a Google Account, a Google Developer Console project, and an API key. You also need to\nactivate the Safe Browsing APIs for use with your project.\n\nIf you need additional help with the steps below, check out the\n[Google API Console Help Center](https://developers.google.com/console/help/new/#usingkeys).\n\n1. Get an account\n-----------------\n\nYou need a Google Account in order to create a project. If you don't already have an account,\nsign up at [Create your Google Account](https://accounts.google.com/SignUp).\n\n2. Create a project\n-------------------\n\nYou need a Google Developer Console project in order to create an API key. If you don't\nalready have a project, see\n[Create, shut down, and restore projects](https://support.google.com/cloud/answer/6251787?hl=en).\n\n\n3. Set up an API key\n--------------------\n\nYou need an API key to access the Safe Browsing APIs. An API key authenticates you as an\nAPI user and allows you to interact with the APIs. You pass this key as a URL parameter in\nyour HTTP requests to the Safe Browsing server. For example, substitute your API key for\n`API_KEY` shown here: \n\n```scdoc\nhttps://safebrowsing.googleapis.com/v4/...?key=API_KEY\n```\n\n\u003cbr /\u003e\n\nTo set up an API key, see\n[Setting up API keys](https://support.google.com/cloud/answer/6158862?hl=en&ref_topic=6262490).\nYour new API key appears in a table---copy and paste this key as needed.\n\n4. Activate the API\n-------------------\n\nFinally, you need to activate the Safe Browsing API for use with your project. To learn\nhow to do this, see\n[Activate and deactivate APIs](https://support.google.com/cloud/answer/6158841?hl=en). The API to enable is referred to as \"Safe Browsing APIs.\"\n\n\nDatabase setup\n--------------\n\nIf you are using the Update API you also need to set up a local database.\nSafe Browsing provides a Go package you can use to get going.\nFor more information, see the Database Setup section under\n[Local Databases](/safe-browsing/v4/local-databases#database-setup).\n\nUsing the APIs\n--------------\n\nBefore you begin, read our [Terms of Service](/safe-browsing/v4/terms) and\n[Pricing](/safe-browsing/v4/pricing) guides. Also, review and make sure you understand\nthe [Usage Limits](/safe-browsing/v4/usage-limits) for the Safe Browsing APIs.\n\nTo start using the Safe Browsing APIs, see these guides:\n\n- [Lookup API (v4)](/safe-browsing/v4/lookup-api)\n- [Update API (v4)](/safe-browsing/v4/update-api)"]]