我试图使用这个电子表格:
https://kennymcnett.com/domain-name-checker-in-google-sheets/我从RapidAPI获得了一个API密钥。
但是,我收到以下错误消息:
Exception: DNS error: https://domainr.p.mashape.com/v2/status?mashape-key=f23.....25c5&domain=undefined (line 30, file "Code")分机的第30行是:
var result = UrlFetchApp.fetch(url+domain);扩展中的所有代码:
// Works as of April 6, 2016
// domainr docs: http://domainr.build/docs/overview
// Get your free API key from https://market.mashape.com/domainr/domainr
// Create an application, get a key
// Put your key into the cell on the "Instructions" sheet
/* sample return JSON from domainr.p.mashape.com
*
* https://domainr.p.mashape.com/v2/status?mashape-key=YOURKEYHERE&domain=testasfkljhsdf.com
*
* Produces:
*
* {"status":[{"domain":"testasfkljhsdf.com","zone":"com","status":"undelegated inactive","summary":"inactive"}]}
*
*/
function domainLookup(domain) {
if (domain == "") {
return "N/A";
}
//Get the Key from cell A11 on the sheet named "Key"
var key = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Instructions').getRange('key').getValue(); //range = named range of the cell with the API key in it
//Submit to mashape
var url = "https://domainr.p.mashape.com/v2/status?mashape-key=" + key + "&domain=";
var result = UrlFetchApp.fetch(url+domain);
var out = JSON.parse(result.getContentText());
var answer = out.status[0].summary;
//Interpret the answer
if (answer == 'undelegated' || answer == 'inactive') {
var finalAnswer = "Available";
} else {
var finalAnswer = "Nope";
}
//Logger.log(out);
//Logger.log(finalAnswer);
//Show the answer
return finalAnswer;
}以下是电子表格中的说明:
For more detailed instructions and other information about this document, see the write-up:
http://kennymcnett.com/domain-name-checker-in-google-sheets/
Instructions
Step 1
Make a copy of this document into your own Google Drive. Then, don't change anything on this sheet except the API Key
Step 2
Get a domainr.com API key from mashape.com
Step 3
Paste your domainr API key from mashape.com below:
f236......................................b0725c5
Step 4
Go to the Domain Names sheet and have fun!
Bonus
If you want to see the script code, go to "Tools > Script editor..."For more detailed instructions and other information about this document, see the write-up:
http://kennymcnett.com/domain-name-checker-in-google-sheets/
Instructions
Step 1
Make a copy of this document into your own Google Drive. Then, don't change anything on this sheet except the API Key
Step 2
Get a domainr.com API key from mashape.com
Step 3
Paste your domainr API key from mashape.com below:
f236.........................................25c5
Step 4
Go to the Domain Names sheet and have fun!
Bonus
If you want to see the script code, go to "Tools > Script editor..."编辑:通过将URL更改为:
domainr.p.rapidapi.com
但是,在这样做之后,我现在收到了一条新的错误消息:
Exception: Request failed for domainr.p.rapidapi.com returned code 403. Truncated server response: {"message":"You are not subscribed to this API."} (use muteHttpExceptions option to examine full response) (line 30).
我到目前为止所做的事情: 1.验证我正在使用的API是一个免费的API。根据这个URL,我使用的子域是这个api的免费版本:https://domainr.p.rapidapi.com (free or non-commercial use) source: https://domainr.com/docs/api。
`
免费API
RapidAPI有数以千计的免费API。顾名思义,您可以在不提供信用卡细节的情况下尝试这些API中的任何一个。这些API显然是免费的。
必需的第三方API密钥
有时,您需要从提供者的网站获取API密钥或令牌。
`
source: https://docs.rapidapi.com/docs/api-pricing
发布于 2020-05-26 16:14:11
这是Domainr的Eric,尝试使用domainr.p.rapidapi.com作为主机名(而不是mashape) -- RapidAPI最近出于某种原因不推荐mashape主机名。
发布于 2020-05-27 04:27:35
这是肯尼,你提到的博客文章的作者。如果您仍然有问题,我已经更新了博客文章,以反映几个变化,这将使您的工作。https://kennymcnett.com/domain-name-checker-in-google-sheets/
https://stackoverflow.com/questions/62013658
复制相似问题