我想知道是否有人通过 .Net 使用 Google Webmaster Tools API 的新搜索分析功能比我更进一步?
我正在使用 Google.Apis.Webmasters.v3 Nuget 包,并且已经进行了身份验证和连接(使用服务帐户)
但是,我很难使用 Search Analytics 去任何地方。
我在网上找不到任何代码示例,因此由https://developers.google.com/resources/api-libraries/documentation/webmasters/v3/csharp/latest/annotated.html上的类信息和很多的猜测。
这是我正在使用的代码:
SearchanalyticsResource mySearchanalyticsResource = new SearchanalyticsResource(service);
SearchAnalyticsQueryRequest myRequest = new SearchAnalyticsQueryRequest();
myRequest.StartDate = "2015-08-01";
myRequest.EndDate = "2015-08-31";
myRequest.RowLimit = 10;
SearchanalyticsResource.QueryRequest myQueryRequest = mySearchanalyticsResource.Query(myRequest, site.SiteUrl);
SearchAnalyticsQueryResponse myQueryResponse = myQueryRequest.Execute();
当我得到“发生错误,但错误响应无法反序列化”时,它运行正常,直到 Execute 方法。下面的异常详细信息...
Newtonsoft.Json.JsonReaderException {“解析 NaN 值时出错。路径 '',第 0 行,位置 0。”}
任何帮助或代码示例将不胜感激!