问题标签 [rapidapi]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
216 浏览

ios - 我无法导入 swiftHTTP (rapidAPI)

我将 SwiftHTTP.xcodeproject 添加到我的项目中,

在构建阶段:我添加了 4 个 SwiftHTTP.framework

ViewController --- 导入 SwiftHTTP

error = "没有这样的模块 SwiftHTTP"

Xcode 6.4 和 7.1 都有这个错误

0 投票
1 回答
1688 浏览

java - RapidApi 安卓

我在搞乱RapidAPI,我不理解他们提供的代码。

有人可以给我拆机吗?它说为了访问 api 我必须编写以下代码

什么是参数键 1 和 2、数据和参数值

edit1:这是我想在 android studio 中使用的代码片段

0 投票
1 回答
859 浏览

javascript - RapidAPI 响应正文显示为“未定义”

我正在使用来自 RapidAPI 的 webcams.travel API(链接到 API doc),并且我已经使用 browserify、unirest、node、require 等设置了所有内容。

API 响应在 json 中,并且正在输出响应标头,但是响应正文应该给我一个带有网络摄像头的对象,但它显示为“未定义”。这是我现在的输出:

控制台输出的图像

是json解析的问题,还是与unirest有关?我很感激任何帮助。

我的 app.js 中的代码(这是来自 API 站点的建议请求片段):

0 投票
1 回答
66 浏览

ruby-on-rails - RapidAPI:“FB”的未定义方法“get_company”:字符串

我正在尝试通过 Rails 应用程序中的 RapidAPI 从 IEX Trading API 中提取数据。我创建了一个搜索表单,其中将使用查询来获取数据,但是即使在控制台中运行良好,也会出现以下错误消息(在此示例中查询为“FB”):

“FB”的未定义方法“get_company”:字符串

股票.rb

stock_controller.rb

首先十分感谢!

0 投票
1 回答
498 浏览

json - 使用 RapidAPI 的 ContextualWeb News API 的 python 客户端

我正在尝试使用ContextualWeb News API。这里描述了端点:

https://rapidapi.com/contextualwebsearch/api/web-search

这是 Python 中的请求片段,如RapidAPI中所述:

如何发送请求并解析响应?能否提供 News API 的完整代码示例?

0 投票
1 回答
264 浏览

php - 在 PHP 中运行 RapidAPI Skyscanner 航班搜索的 POST 创建会话时出现 405 错误

我正在尝试从 POST 创建会话的响应中获取位置标头,但出现 405 错误。除了位置标头之外,我得到的所有其他响应。

我期待这种类型的回应:

但是,实际输出是:

Unirest\Response Object ( [code] => 405 [raw_body] => {} [body] => stdClass Object () [headers] => Array ([0] => HTTP/1.1 405 Method Not Allowed [Cache-Control ] => private [Content-Type] => application/json [Date] => Wed, 24 Apr 2019 04:34:14 GMT [Server] => RapidAPI-1.0.15 [X-RapidAPI-Region] => AWS - ap-southeast-1 [X-RapidAPI-Version] => 1.0.15 [Content-Length] => 2 [Connection] => keep-alive ) )

0 投票
2 回答
864 浏览

php - 从外部 API RapidApi 获取数据到 Wordpress 站点

我正在尝试从此 API 获取数据:

我设法使用 wp_remote_get() 发出请求,但除了错误之外,我一直没有显示任何结果:

我只是指出我已经使用 Composer 在包含请求的 XAMPP 正确文件夹中设置 Composer.json 文件:

在我的代码中,我包含了 API 密钥的参数,如下所示,但由于某种原因不起作用:

0 投票
1 回答
1762 浏览

oauth-2.0 - how to generate X-RapidAPI-Key without accessing https://rapidapi.com via Browser

This question was originaly posted in rapidapi forum

Basically, I want to use one of the free APIs provided by RapidApi (skyscanner api)..

It is quite straighfoward if you log in RapidApi. You are rerdirected to OAUTH2 server (gmail in my case) and then X-RapidAPI-Key is filled in automatically. I want to call it from my application but how can I retrieve X-RapidAPI-Key?

For instance, I guess I can call via PostMan some url from RapidApi.com which will redirect me to gmail and then I log in and it will provide me such X-RapidAPI-Key. I have looked for such info in their site but I didn't find it. Maybe it is so obvious but I don't know how to figure out it.

I assume it is exactly what it is happening behind the scene when rapidApi.com ask me to log in with my gmail/github/facebook account. Kindly, don't misunderstand my question as asking how to develop or consume an OAUTH2 server. It is quite specific about getting X-RapidAPI-Key from rapidapi.com without accessing it throw a browser.

0 投票
1 回答
253 浏览

swift - 使用提供 nsurlsession 的 rapidapi 访问 json

我正在尝试在我的 xcode 项目中快速使用这个天气 api https://rapidapi.com/interzoid/api/us-weather-by-zip-code/endpoints 。他们为我提供了代码

运行它后,我得到了响应头,但我希望得到响应体,即 json。我对此还是很陌生,希望您能提供帮助。

0 投票
2 回答
292 浏览

api - SkyScanner RapidAPI 不提供回程航班

对于个人项目,我正在尝试通过 RapidAPI 在 GO 中使用 Sky Scanner API。这是我用来执行 API 请求的 URL:

https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browsequotes/v1.0/UK/GBP/en-US/SFO-sky/JFK-sky/2019-12-01?入站部分日期=2019-12-10

问题是,我只收到以下回复:

据我所知,这不包含回程航班。

我想知道是否有人有使用此的经验/知道我哪里出错了。

谢谢!