简体   繁体   English

谷歌搜索控制台 API 返回 404

[英]Google search Console API return 404

I would like to simply fetch some data from Google Search Console via API.我想通过 API 从 Google Search Console 中获取一些数据。 I am struggling with Oauth2 for days but to be hones I don't really know what is it, and how it should be used.我在 Oauth2 上苦苦挣扎了好几天,但老实说,我真的不知道它是什么,以及应该如何使用它。 I don't really mind about security, it is not a super secret project, so I am trying to get some data with a simple API key, but it doesn't work neither.我真的不介意安全性,它不是一个超级秘密项目,所以我试图用一个简单的 API 密钥获取一些数据,但它也不起作用。 I have an API key what I generated in Google Cloud Console我有一个在 Google Cloud Console 中生成的 API 密钥在此处输入图像描述 I am trying to get data with Postman based on this example, but I always get 404 error.我正在尝试根据此示例使用 Postman 获取数据,但我总是收到 404 错误。 在此处输入图像描述

**Can you help me what do I wrong? **你能帮我做错什么吗? It shouldn't be so complicated.它不应该那么复杂。 ** **

You're using the wrong url;您使用了错误的 url; webmaster should be webmasters . webmaster应该是webmasters See here这里

Additionally, once you solve that you will get a 401 using only an API token.此外,一旦您解决了这个问题,您将仅使用 API 令牌获得 401。 You need to use OAuth.您需要使用 OAuth。 If you want this to run regularly, you can authorize it once with an account and use something called a refresh token .如果您希望它定期运行,您可以使用一个帐户对其进行一次授权,并使用一种称为刷新令牌的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM