Upload folder using huggingface_hub (part 11)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +1 -0
- toolbench/toolenv/tools/Data/radio_stations.json +0 -0
- toolbench/toolenv/tools/Data/railway_periods.json +53 -0
- toolbench/toolenv/tools/Data/railway_periods/api.py +32 -0
- toolbench/toolenv/tools/Data/rainforest.json +0 -0
- toolbench/toolenv/tools/Data/rainforest/api.py +1352 -0
- toolbench/toolenv/tools/Data/randgenlocality_api.json +54 -0
- toolbench/toolenv/tools/Data/random_article_generator.json +116 -0
- toolbench/toolenv/tools/Data/random_choise.json +54 -0
- toolbench/toolenv/tools/Data/random_choose_champion_legend_of_league.json +54 -0
- toolbench/toolenv/tools/Data/random_chunk_api.json +529 -0
- toolbench/toolenv/tools/Data/random_chunk_api/api.py +246 -0
- toolbench/toolenv/tools/Data/random_dog_photos/api.py +29 -0
- toolbench/toolenv/tools/Data/random_fact.json +54 -0
- toolbench/toolenv/tools/Data/random_famous_quotes.json +46 -0
- toolbench/toolenv/tools/Data/random_famous_quotes/api.py +35 -0
- toolbench/toolenv/tools/Data/random_identity_generator/api.py +39 -0
- toolbench/toolenv/tools/Data/random_indonesian_word.json +37 -0
- toolbench/toolenv/tools/Data/random_indonesian_word/api.py +32 -0
- toolbench/toolenv/tools/Data/random_mockup_person.json +54 -0
- toolbench/toolenv/tools/Data/random_name_and_gender_generator.json +45 -0
- toolbench/toolenv/tools/Data/random_name_and_gender_generator/api.py +29 -0
- toolbench/toolenv/tools/Data/random_quote_api/api.py +29 -0
- toolbench/toolenv/tools/Data/random_quotes.json +30 -0
- toolbench/toolenv/tools/Data/random_quotes_v1.json +64 -0
- toolbench/toolenv/tools/Data/random_quotes_v1/api.py +29 -0
- toolbench/toolenv/tools/Data/random_user_by_api_ninjas.json +30 -0
- toolbench/toolenv/tools/Data/random_user_by_api_ninjas/api.py +29 -0
- toolbench/toolenv/tools/Data/random_users_data/api.py +29 -0
- toolbench/toolenv/tools/Data/random_word_api.json +213 -0
- toolbench/toolenv/tools/Data/random_word_api/api.py +203 -0
- toolbench/toolenv/tools/Data/random_word_generator.json +56 -0
- toolbench/toolenv/tools/Data/random_word_generator/api.py +54 -0
- toolbench/toolenv/tools/Data/randomcompanyinfoapi.json +54 -0
- toolbench/toolenv/tools/Data/randomizer.json +107 -0
- toolbench/toolenv/tools/Data/randomizer/api.py +45 -0
- toolbench/toolenv/tools/Data/randompointsgenerator_api.json +54 -0
- toolbench/toolenv/tools/Data/randomprofile.json +70 -0
- toolbench/toolenv/tools/Data/ranking_page/api.py +92 -0
- toolbench/toolenv/tools/Data/rapidapi_example/api.py +29 -0
- toolbench/toolenv/tools/Data/rata_incidenta_romania/api.py +50 -0
- toolbench/toolenv/tools/Data/rate_checker_by_wubook/api.py +83 -0
- toolbench/toolenv/tools/Data/rchilli_taxonomy.json +39 -0
- toolbench/toolenv/tools/Data/react_weather/api.py +29 -0
- toolbench/toolenv/tools/Data/real_estate_records.json +130 -0
- toolbench/toolenv/tools/Data/real_estate_records/api.py +175 -0
- toolbench/toolenv/tools/Data/real_time_climate_index.json +30 -0
- toolbench/toolenv/tools/Data/real_time_climate_index/api.py +29 -0
- toolbench/toolenv/tools/Data/real_time_image_search.json +128 -0
- toolbench/toolenv/tools/Data/real_time_image_search/api.py +78 -0
.gitattributes
CHANGED
|
@@ -63,3 +63,4 @@ tau2/domains/telecom/tasks.json filter=lfs diff=lfs merge=lfs -text
|
|
| 63 |
tau2/domains/telecom/tasks_full.json filter=lfs diff=lfs merge=lfs -text
|
| 64 |
tau2/domains/telecom/tasks_voice.json filter=lfs diff=lfs merge=lfs -text
|
| 65 |
toolbench/toolenv/tools/Business/ziff.json filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 63 |
tau2/domains/telecom/tasks_full.json filter=lfs diff=lfs merge=lfs -text
|
| 64 |
tau2/domains/telecom/tasks_voice.json filter=lfs diff=lfs merge=lfs -text
|
| 65 |
toolbench/toolenv/tools/Business/ziff.json filter=lfs diff=lfs merge=lfs -text
|
| 66 |
+
toolbench/toolenv/tools/Data/twitter_data.json filter=lfs diff=lfs merge=lfs -text
|
toolbench/toolenv/tools/Data/radio_stations.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
toolbench/toolenv/tools/Data/railway_periods.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name":"Railway Periods",
|
| 3 |
+
"tool_description":"An API to calculate the railway period of a UTC date in milliseconds since epoch (Unix timestamp).",
|
| 4 |
+
"title":"Railway Periods",
|
| 5 |
+
"pricing":"FREEMIUM",
|
| 6 |
+
"score":{
|
| 7 |
+
"avgServiceLevel":100,
|
| 8 |
+
"avgLatency":5504,
|
| 9 |
+
"avgSuccessRate":100,
|
| 10 |
+
"popularityScore":8.1,
|
| 11 |
+
"__typename":"Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url":"https://rapidapi.com/GavinBeattie/api/railway-periods/",
|
| 14 |
+
"host":"railway-periods.p.rapidapi.com",
|
| 15 |
+
"api_list":[
|
| 16 |
+
{
|
| 17 |
+
"name":"Get Railway Period for UTC date",
|
| 18 |
+
"url":"https://railway-periods.p.rapidapi.com/millis/{millis}",
|
| 19 |
+
"description":"This endpoint will return railway period between:\n{\"millis\":\"0\",\"railwayPeriod\":\"1969-1970 P10\"} (01/01/1970 00:00:00)\nAnd\n{\"millis\":\"8640000000000\",\"railwayPeriod\":\"2243-2244 P8\"} (17/10/2243 00:00:00)",
|
| 20 |
+
"method":"GET",
|
| 21 |
+
"required_parameters":[
|
| 22 |
+
{
|
| 23 |
+
"name":"millis",
|
| 24 |
+
"type":"NUMBER",
|
| 25 |
+
"description":"",
|
| 26 |
+
"default":"1654470000000"
|
| 27 |
+
}
|
| 28 |
+
],
|
| 29 |
+
"optional_parameters":[],
|
| 30 |
+
"code":"import requests\n\nurl = \"https://railway-periods.p.rapidapi.com/millis/{millis}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"railway-periods.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 31 |
+
"statuscode":200,
|
| 32 |
+
"body":{
|
| 33 |
+
"millis":"1654470000000",
|
| 34 |
+
"railwayPeriod":"2022-2023 P3"
|
| 35 |
+
},
|
| 36 |
+
"headers":{
|
| 37 |
+
"access-control-allow-credentials":"true",
|
| 38 |
+
"access-control-allow-origin":"*",
|
| 39 |
+
"connection":"keep-alive",
|
| 40 |
+
"content-length":"57",
|
| 41 |
+
"content-type":"application/json; charset=utf-8",
|
| 42 |
+
"date":"Mon, 06 Jun 2022 22:57:23 GMT",
|
| 43 |
+
"etag":"W/\"39-l5YFPg0nB2pL6zJIKN+eUHR0T2Q\"",
|
| 44 |
+
"server":"RapidAPI-1.2.8",
|
| 45 |
+
"via":"1.1 vegur",
|
| 46 |
+
"x-powered-by":"Express",
|
| 47 |
+
"x-rapidapi-region":"AWS - eu-west-1",
|
| 48 |
+
"x-rapidapi-version":"1.2.8"
|
| 49 |
+
},
|
| 50 |
+
"schema":{}
|
| 51 |
+
}
|
| 52 |
+
]
|
| 53 |
+
}
|
toolbench/toolenv/tools/Data/railway_periods/api.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def get_railway_period_for_utc_date(millis: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"This endpoint will return railway period between:
|
| 12 |
+
{"millis":"0","railwayPeriod":"1969-1970 P10"} (01/01/1970 00:00:00)
|
| 13 |
+
And
|
| 14 |
+
{"millis":"8640000000000","railwayPeriod":"2243-2244 P8"} (17/10/2243 00:00:00)"
|
| 15 |
+
|
| 16 |
+
"""
|
| 17 |
+
url = f"https://railway-periods.p.rapidapi.com/millis/{millis}"
|
| 18 |
+
querystring = {}
|
| 19 |
+
|
| 20 |
+
headers = {
|
| 21 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 22 |
+
"X-RapidAPI-Host": "railway-periods.p.rapidapi.com"
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 27 |
+
try:
|
| 28 |
+
observation = response.json()
|
| 29 |
+
except:
|
| 30 |
+
observation = response.text
|
| 31 |
+
return observation
|
| 32 |
+
|
toolbench/toolenv/tools/Data/rainforest.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
toolbench/toolenv/tools/Data/rainforest/api.py
ADDED
|
@@ -0,0 +1,1352 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def author_page(type: str, url: str=None, format_id: str=None, amazon_domain: str='amazon.com', asin: str='B000APVZ7W', page: int=None, sort_by: str=None, customer_location: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"The Author Page Parameters are applicable when making a request with type=author_page to retrieve data from the authors page single author on Amazon - the author is specified using either the author asin and amazon_domain parameters or the url parameter (where the url parameter contains a link to an Amazon authors page). The parameters should be appended as querystring parameters to the Product Data API GET HTTP request.
|
| 12 |
+
|
| 13 |
+
Author Page data is retrieved from the author page for a single author on Amazon."
|
| 14 |
+
url:
|
| 15 |
+
The Amazon author page URL to retrieve data from.
|
| 16 |
+
|
| 17 |
+
Note: If the url parameter is supplied then the amazon_domain and asin parameters are ignored.
|
| 18 |
+
format_id:
|
| 19 |
+
A format ID to determine the format of author titles returned in the titles array. Format ID's are returned in the format_ids array in each type=author_page results (this is necessary are the format_id value is dynamic and can change over time).
|
| 20 |
+
amazon_domain: The Amazon domain to retrieve author page data for the author specified in the asin parameter. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 21 |
+
|
| 22 |
+
Note: If the amazon_domain and asin parameters are supplied then the url parameter is ignored.
|
| 23 |
+
asin:
|
| 24 |
+
The Amazon author ASIN to retrieve author page data for. Used in combination with the amazon_domain parameter.
|
| 25 |
+
|
| 26 |
+
Note: If the asin and amazon_domain parameters are supplied then the url parameter is ignored.
|
| 27 |
+
page: The current page of search results to retrieve. Inspect the pagination.total_pages property in the Search results to see how many pages of search results are available.
|
| 28 |
+
|
| 29 |
+
update value of num to get additional pages
|
| 30 |
+
sort_by: Determines the sort order of author titles array that is returned. Valid values are:
|
| 31 |
+
popularity
|
| 32 |
+
Sort the author titles array by most popular first.
|
| 33 |
+
price_low_to_high
|
| 34 |
+
Sort the author titles array by lowest price first.
|
| 35 |
+
price_high_to_low
|
| 36 |
+
Sort the author titles array by highest price first.
|
| 37 |
+
average_review
|
| 38 |
+
Sort the author titles array by highest average review first.
|
| 39 |
+
publication_date
|
| 40 |
+
Sort the author titles array by most recent publication date first.
|
| 41 |
+
most_reviews
|
| 42 |
+
Sort the author titles array by those with the most reviews first.
|
| 43 |
+
|
| 44 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 45 |
+
|
| 46 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 47 |
+
|
| 48 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 49 |
+
|
| 50 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. \"France\" for requests for pages from \"amazon.fr\".
|
| 51 |
+
|
| 52 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 53 |
+
|
| 54 |
+
See the Request Parameters documentation for more information.
|
| 55 |
+
|
| 56 |
+
"""
|
| 57 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 58 |
+
querystring = {'type': type, }
|
| 59 |
+
if url:
|
| 60 |
+
querystring['url'] = url
|
| 61 |
+
if format_id:
|
| 62 |
+
querystring['format_id'] = format_id
|
| 63 |
+
if amazon_domain:
|
| 64 |
+
querystring['amazon_domain'] = amazon_domain
|
| 65 |
+
if asin:
|
| 66 |
+
querystring['asin'] = asin
|
| 67 |
+
if page:
|
| 68 |
+
querystring['page'] = page
|
| 69 |
+
if sort_by:
|
| 70 |
+
querystring['sort_by'] = sort_by
|
| 71 |
+
if customer_location:
|
| 72 |
+
querystring['customer_location'] = customer_location
|
| 73 |
+
|
| 74 |
+
headers = {
|
| 75 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 76 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 81 |
+
try:
|
| 82 |
+
observation = response.json()
|
| 83 |
+
except:
|
| 84 |
+
observation = response.text
|
| 85 |
+
return observation
|
| 86 |
+
|
| 87 |
+
def also_bought(type: str, url: str=None, asin: str='B084ZF5D65', amazon_domain: str='amazon.com', customer_location: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 88 |
+
"""
|
| 89 |
+
"The Also Bought Parameters are applicable when making a request with type=also_bought to retrieve also bought details for a single product on Amazon - the product is specified using either the asin and amazon_domain parameters or the url parameter (where the url parameter contains a link to an Amazon product page). The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request.
|
| 90 |
+
|
| 91 |
+
Also bought details are retrieved from the product page for a single product on Amazon. An type=also_bought request will automatically paginate through all of the pages of also-bought data and return every also bought result."
|
| 92 |
+
url: The Amazon product page URL to retrieve also bought results from.
|
| 93 |
+
|
| 94 |
+
asin: The Amazon ASIN (product ID) to retrieve also bought details for. Used in combination with the amazon_domain parameter.
|
| 95 |
+
|
| 96 |
+
Note: If the asin and amazon_domain parameters are supplied then the url parameter is ignored.
|
| 97 |
+
amazon_domain:
|
| 98 |
+
The Amazon domain to retrieve also bought details from for the product specified in the asin parameter. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 99 |
+
|
| 100 |
+
Note: If the amazon_domain and asin parameters are supplied then the url parameter is ignored.
|
| 101 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 102 |
+
|
| 103 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 104 |
+
|
| 105 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 106 |
+
|
| 107 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. \"France\" for requests for pages from \"amazon.fr\".
|
| 108 |
+
|
| 109 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 110 |
+
|
| 111 |
+
See the Request Parameters documentation for more information.
|
| 112 |
+
|
| 113 |
+
"""
|
| 114 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 115 |
+
querystring = {'type': type, }
|
| 116 |
+
if url:
|
| 117 |
+
querystring['url'] = url
|
| 118 |
+
if asin:
|
| 119 |
+
querystring['asin'] = asin
|
| 120 |
+
if amazon_domain:
|
| 121 |
+
querystring['amazon_domain'] = amazon_domain
|
| 122 |
+
if customer_location:
|
| 123 |
+
querystring['customer_location'] = customer_location
|
| 124 |
+
|
| 125 |
+
headers = {
|
| 126 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 127 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 132 |
+
try:
|
| 133 |
+
observation = response.json()
|
| 134 |
+
except:
|
| 135 |
+
observation = response.text
|
| 136 |
+
return observation
|
| 137 |
+
|
| 138 |
+
def offers(type: str, offers_prime: bool=None, offers_condition_used_very_good: bool=None, offers_condition_used_acceptable: bool=None, offers_condition_new: bool=None, url: str=None, page: int=None, offers_condition_used_like_new: bool=None, amazon_domain: str='amazon.com', asin: str='B073JYC4XM', gtin: str=None, offers_condition_used_good: bool=None, offers_free_shipping: bool=None, customer_location: str=None, show_different_asins: bool=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 139 |
+
"""
|
| 140 |
+
"Offers are retrieved from the offers listing popup window for a single product on Amazon.
|
| 141 |
+
|
| 142 |
+
The Offers Parameters are applicable when making a request with type=offers to retrieve seller Offers for a single product on Amazon - the product is specified using either the asin and amazon_domain parameters or the url parameter (where the url parameter contains a link to an Amazon product offers page). The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request."
|
| 143 |
+
offers_prime:
|
| 144 |
+
Limit the offers returned to just those that are Prime-eligible. Valid values are:
|
| 145 |
+
true
|
| 146 |
+
Only include offers that are Prime-eligible.
|
| 147 |
+
false
|
| 148 |
+
Include all offers, regardless of whether they are Prime-eligible or not.
|
| 149 |
+
page: The current page of search results to retrieve. Inspect the pagination.total_pages property in the Search results to see how many pages of search results are available.
|
| 150 |
+
|
| 151 |
+
update value of num to get additional pages
|
| 152 |
+
amazon_domain: The Amazon domain to retrieve Offers for the product specified in the asin parameter from. For a full list of supported Amazon domains see [Supported Amazon Domains.](https://www.rainforestapi.com/docs/product-data-api/reference/amazon-domains)
|
| 153 |
+
|
| 154 |
+
**Note: If the amazon_domain and asin parameters are supplied then the url parameter is ignored.**
|
| 155 |
+
asin: The Amazon ASIN (product ID) to retrieve Offers for. Used in combination with the amazon_domain parameter.
|
| 156 |
+
|
| 157 |
+
**Note: If the asin and amazon_domain parameters are supplied then the url parameter is ignored.**
|
| 158 |
+
gtin: A GTIN, ISBN, UPC or EAN code to retrieve results for. Internally Rainforest will first convert the GTIN/ISBN/UPC/EAN to an Amazon ASIN, then retrieve the results for that ASIN from Amazon. Used in combination with the amazon_domain parameter.
|
| 159 |
+
|
| 160 |
+
Note: If the gtin and amazon_domain parameters are supplied then the url parameter is ignored.
|
| 161 |
+
offers_free_shipping:
|
| 162 |
+
Limit the offers returned to just those that have Free Shipping. Valid values are:
|
| 163 |
+
true
|
| 164 |
+
Only include offers that have Free Shipping.
|
| 165 |
+
false
|
| 166 |
+
Include all offers, regardless of whether they have Free Shipping or not.
|
| 167 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 168 |
+
|
| 169 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 170 |
+
|
| 171 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 172 |
+
|
| 173 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. `France` for requests for pages from `amazon.fr`
|
| 174 |
+
|
| 175 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 176 |
+
|
| 177 |
+
See the Request Parameters documentation for more information.
|
| 178 |
+
show_different_asins: Sometimes Amazon will return Offers from ASINs other than the ASIN supplied in the asin request parameter (for example, when the original ASIN is out of stock). show_different_asins controls whether you want these other-ASIN offer results returned, or not. Can be set to true to include offers from other ASINs, or false (the default) to hide offers from ASINs other than the ASIN supplied in the asin parameter. Note that if you supply a url instead of asin in your request this parameter is ignored.
|
| 179 |
+
|
| 180 |
+
"""
|
| 181 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 182 |
+
querystring = {'type': type, }
|
| 183 |
+
if offers_prime:
|
| 184 |
+
querystring['offers_prime'] = offers_prime
|
| 185 |
+
if offers_condition_used_very_good:
|
| 186 |
+
querystring['offers_condition_used_very_good'] = offers_condition_used_very_good
|
| 187 |
+
if offers_condition_used_acceptable:
|
| 188 |
+
querystring['offers_condition_used_acceptable'] = offers_condition_used_acceptable
|
| 189 |
+
if offers_condition_new:
|
| 190 |
+
querystring['offers_condition_new'] = offers_condition_new
|
| 191 |
+
if url:
|
| 192 |
+
querystring['url'] = url
|
| 193 |
+
if page:
|
| 194 |
+
querystring['page'] = page
|
| 195 |
+
if offers_condition_used_like_new:
|
| 196 |
+
querystring['offers_condition_used_like_new'] = offers_condition_used_like_new
|
| 197 |
+
if amazon_domain:
|
| 198 |
+
querystring['amazon_domain'] = amazon_domain
|
| 199 |
+
if asin:
|
| 200 |
+
querystring['asin'] = asin
|
| 201 |
+
if gtin:
|
| 202 |
+
querystring['gtin'] = gtin
|
| 203 |
+
if offers_condition_used_good:
|
| 204 |
+
querystring['offers_condition_used_good'] = offers_condition_used_good
|
| 205 |
+
if offers_free_shipping:
|
| 206 |
+
querystring['offers_free_shipping'] = offers_free_shipping
|
| 207 |
+
if customer_location:
|
| 208 |
+
querystring['customer_location'] = customer_location
|
| 209 |
+
if show_different_asins:
|
| 210 |
+
querystring['show_different_asins'] = show_different_asins
|
| 211 |
+
|
| 212 |
+
headers = {
|
| 213 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 214 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
|
| 218 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 219 |
+
try:
|
| 220 |
+
observation = response.json()
|
| 221 |
+
except:
|
| 222 |
+
observation = response.text
|
| 223 |
+
return observation
|
| 224 |
+
|
| 225 |
+
def questions(type: str, asin: str='B073JYC4XM', sort_by: str=None, customer_location: str=None, amazon_domain: str='amazon.com', page: int=None, url: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 226 |
+
"""
|
| 227 |
+
"The Questions Parameters are applicable when making a request with type=questions to retrieve customer Questions & Answers for a single product on Amazon - the product is specified using either the asin and amazon_domain parameters or the url parameter (where the url parameter contains a link to an Amazon product page). The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request.
|
| 228 |
+
|
| 229 |
+
Questions are retrieved from the customer questions page for a single product on Amazon"
|
| 230 |
+
asin: The Amazon ASIN (product ID) to retrieve Questions & Answers for. Used in combination with the amazon_domain parameter.
|
| 231 |
+
|
| 232 |
+
**Note: If the asin and amazon_domain parameters are supplied then the url parameter is ignored.**
|
| 233 |
+
sort_by: Determines the sort order of Questions & Answers to return. Valid values are:
|
| 234 |
+
|
| 235 |
+
most_helpful
|
| 236 |
+
Returns Questions & Answers with the most helpful first.
|
| 237 |
+
most_recent
|
| 238 |
+
Returns Questions & Answers in date order, with the most recent first.
|
| 239 |
+
|
| 240 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 241 |
+
|
| 242 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 243 |
+
|
| 244 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 245 |
+
|
| 246 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. \\\"France\\\" for requests for pages from \\\"amazon.fr\\\".
|
| 247 |
+
|
| 248 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 249 |
+
|
| 250 |
+
See the Request Parameters documentation for more information.
|
| 251 |
+
amazon_domain: The Amazon domain to retrieve Questions & Answers for the product specified in the asin parameter from. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 252 |
+
|
| 253 |
+
**Note: If the amazon_domain and asin parameters are supplied then the url parameter is ignored.**
|
| 254 |
+
page: The current page of search results to retrieve. Inspect the pagination.total_pages property in the Search results to see how many pages of search results are available.
|
| 255 |
+
|
| 256 |
+
update value of num to get additional pages
|
| 257 |
+
url: The Amazon product-page URL to retrieve Questions & Answers from.
|
| 258 |
+
|
| 259 |
+
**Note: If the url parameter is supplied then the amazon_domain and asin parameters are ignored.**
|
| 260 |
+
|
| 261 |
+
"""
|
| 262 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 263 |
+
querystring = {'type': type, }
|
| 264 |
+
if asin:
|
| 265 |
+
querystring['asin'] = asin
|
| 266 |
+
if sort_by:
|
| 267 |
+
querystring['sort_by'] = sort_by
|
| 268 |
+
if customer_location:
|
| 269 |
+
querystring['customer_location'] = customer_location
|
| 270 |
+
if amazon_domain:
|
| 271 |
+
querystring['amazon_domain'] = amazon_domain
|
| 272 |
+
if page:
|
| 273 |
+
querystring['page'] = page
|
| 274 |
+
if url:
|
| 275 |
+
querystring['url'] = url
|
| 276 |
+
|
| 277 |
+
headers = {
|
| 278 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 279 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
|
| 283 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 284 |
+
try:
|
| 285 |
+
observation = response.json()
|
| 286 |
+
except:
|
| 287 |
+
observation = response.text
|
| 288 |
+
return observation
|
| 289 |
+
|
| 290 |
+
def deals(type: str, prime_eligible: bool=None, minimum_rating: str='1_and_up', deal_states: str=None, amazon_domain: str='amazon.com', category_id: str='2619525011', url: str=None, sort_by: str='price_high_to_low', deal_types: str='best_deal', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 291 |
+
"""
|
| 292 |
+
"The Deals Parameters are applicable when making a request with type=deals to retrieve Lightning Deal / Daily Deals results for an Amazon lightning deals / daily deals / 'goldbox' page. The category of deals and Amazon domain are specified using the category_id and amazon_domain parameter. The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request.
|
| 293 |
+
|
| 294 |
+
Deals results are retrieved from the deals listing page on Amazon.
|
| 295 |
+
|
| 296 |
+
You can retrieve category IDs for each amazon_domain using the Categories API. Category IDs are also returned in the categories array in each type=deals response.
|
| 297 |
+
|
| 298 |
+
Multiple category IDs can be supplied, comma seperated, in the category_id parameter. For example, to request deals for Beauty (3760911) and Electronics (172282) categories on amazon.com the parameters would be category_id=3760911,172282&amazon_domain=amazon.com.
|
| 299 |
+
|
| 300 |
+
If you wish to retrieve Deals from the deals homepage for a given amazon_domain, simply omit the category_id parameter entirely."
|
| 301 |
+
minimum_rating: Only include deals for products with a customer rating meeting the specified criteria. If you omit the minimum_rating parameter deals for products with any rating are included. Valid values are:
|
| 302 |
+
|
| 303 |
+
1_and_up
|
| 304 |
+
Include deals for products with a 1-star customer rating and upwards.
|
| 305 |
+
2_and_up
|
| 306 |
+
Include deals for products with a 2-star customer rating and upwards.
|
| 307 |
+
3_and_up
|
| 308 |
+
Include deals for products with a 3-star customer rating and upwards.
|
| 309 |
+
4_and_up
|
| 310 |
+
Include deals for products with a 4-star customer rating and upwards.
|
| 311 |
+
deal_states: The types of deal state to include. If you omit the deal_states parameter then all deal states are included.
|
| 312 |
+
|
| 313 |
+
**Note multiple deal states can be specified, comma-separated.**
|
| 314 |
+
|
| 315 |
+
Valid values are:
|
| 316 |
+
- available
|
| 317 |
+
- Include available-state deals.
|
| 318 |
+
|
| 319 |
+
upcoming
|
| 320 |
+
Include upcoming-state deals.
|
| 321 |
+
expired
|
| 322 |
+
Include expired-state deals.
|
| 323 |
+
amazon_domain: The Amazon domain to retrieve Deals from for the category ID(s) specified in the category_id parameter. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 324 |
+
category_id: A comma-seperated list of Deals category IDs to retrieve deals results from, as returned by the Categories API. Category IDs are also returned in the categories array in each type=deals response.
|
| 325 |
+
|
| 326 |
+
Multiple category IDs can be supplied, comma seperated, in the category_id parameter. For example, to request deals for Beauty (3760911) and Electronics (172282) categories on amazon.com the parameters would be category_id=3760911,172282&amazon_domain=amazon.com.
|
| 327 |
+
|
| 328 |
+
If you wish to retrieve Deals from the deals homepage for a given amazon_domain, simply omit the category_id parameter entirely.
|
| 329 |
+
url: The Amazon deals page URL to retrieve deals results from. This parameter, as it specifies a URL, should itself be url encoded.
|
| 330 |
+
|
| 331 |
+
**Note using the url parameter for Deals requests is not recommended as due to the session and pagination characteristics of the Deals pages simply specifying the url can prove unreliable in all but the simplest use-cases. It is recommended that you use the category_id and amazon_domain parameters to specify your Deals request instead.**
|
| 332 |
+
sort_by: Determines the sort order of the deals returned.
|
| 333 |
+
|
| 334 |
+
Valid values are:
|
| 335 |
+
|
| 336 |
+
featured
|
| 337 |
+
Sort by featured deals.
|
| 338 |
+
discount_low_to_high
|
| 339 |
+
Sort by discount, lowest discount first.
|
| 340 |
+
discount_high_to_low
|
| 341 |
+
Sort by discount, highest discount first.
|
| 342 |
+
price_low_to_high
|
| 343 |
+
Sort by price, lowest price first.
|
| 344 |
+
price_high_to_low
|
| 345 |
+
Sort by price, highest price first.
|
| 346 |
+
deal_types: The types of deal to include. If you omit the deal_types parameter then all deal types are included.
|
| 347 |
+
|
| 348 |
+
**Note multiple deal types can be specified, comma-separated.**
|
| 349 |
+
Valid values are:
|
| 350 |
+
|
| 351 |
+
deal_of_the_day
|
| 352 |
+
Include deal-of-the-day deals.
|
| 353 |
+
lightning_deal
|
| 354 |
+
Include lightning deals.
|
| 355 |
+
best_deal
|
| 356 |
+
Include best-deal deals.
|
| 357 |
+
|
| 358 |
+
"""
|
| 359 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 360 |
+
querystring = {'type': type, }
|
| 361 |
+
if prime_eligible:
|
| 362 |
+
querystring['prime_eligible'] = prime_eligible
|
| 363 |
+
if minimum_rating:
|
| 364 |
+
querystring['minimum_rating'] = minimum_rating
|
| 365 |
+
if deal_states:
|
| 366 |
+
querystring['deal_states'] = deal_states
|
| 367 |
+
if amazon_domain:
|
| 368 |
+
querystring['amazon_domain'] = amazon_domain
|
| 369 |
+
if category_id:
|
| 370 |
+
querystring['category_id'] = category_id
|
| 371 |
+
if url:
|
| 372 |
+
querystring['url'] = url
|
| 373 |
+
if sort_by:
|
| 374 |
+
querystring['sort_by'] = sort_by
|
| 375 |
+
if deal_types:
|
| 376 |
+
querystring['deal_types'] = deal_types
|
| 377 |
+
|
| 378 |
+
headers = {
|
| 379 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 380 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
|
| 384 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 385 |
+
try:
|
| 386 |
+
observation = response.json()
|
| 387 |
+
except:
|
| 388 |
+
observation = response.text
|
| 389 |
+
return observation
|
| 390 |
+
|
| 391 |
+
def autcomplete(search_term: str, type: str, amazon_domain: str, autcomplete_alias: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 392 |
+
"""
|
| 393 |
+
"When making a request with the type parameter set to type=autocomplete Rainforest API will return autocomplete suggestions for the search term specified in the search_term parameter, on the Amazon domain specified in the amazon_domain parameter.
|
| 394 |
+
You may scope your autocomplete request to an Amazon autocomplete alias (synonymous with a product area or top-level category) by specifying the alias using the autocomplete_alias parameter. The available autocomplete_alias values vary depending on the amazon_domain used. You can find a full list of all autocomplete aliaes, per Amazon-domain, in the autocomplete aliases reference."
|
| 395 |
+
search_term: The search term to get autocomplete suggestions for. Used in combination with the amazon_domain parameter.
|
| 396 |
+
type: The Amazon domain to retrieve autocomplete details from for the search term specified in the search_term parameter. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 397 |
+
autcomplete_alias:
|
| 398 |
+
The alias to use to scope the autocomplete request. Autocomplete aliases can be thought of as the \"category\" area that the autocomplete request runs in. If none is specified then Rainforest will default to running the autocomplete request in the top-level \"All Departments\" autocomplete alias.
|
| 399 |
+
|
| 400 |
+
For a full list of supported Autocomplete Aliases see Supported Autocomplete Aliases.
|
| 401 |
+
|
| 402 |
+
"""
|
| 403 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 404 |
+
querystring = {'search_term': search_term, 'type': type, 'amazon_domain': amazon_domain, }
|
| 405 |
+
if autcomplete_alias:
|
| 406 |
+
querystring['autcomplete_alias'] = autcomplete_alias
|
| 407 |
+
|
| 408 |
+
headers = {
|
| 409 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 410 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 411 |
+
}
|
| 412 |
+
|
| 413 |
+
|
| 414 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 415 |
+
try:
|
| 416 |
+
observation = response.json()
|
| 417 |
+
except:
|
| 418 |
+
observation = response.text
|
| 419 |
+
return observation
|
| 420 |
+
|
| 421 |
+
def asin_to_gtin(amazon_domain: str, type: str, asin: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 422 |
+
"""
|
| 423 |
+
"When making a request with the type parameter set to type=asin_to_gtin Rainforest API will attempt to look up GTIN / EAN / UPC / ISBN numbers for the ASIN and Amazon domain specified in the asin and amazon_domain parameters."
|
| 424 |
+
amazon_domain: The Amazon domain to retrieve ASIN to GTIN details from for the ASIN specified in the asin parameter. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 425 |
+
asin: The Amazon ASIN (product ID) to retrieve GTIN(s) for. Used in combination with the amazon_domain parameter.
|
| 426 |
+
|
| 427 |
+
"""
|
| 428 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 429 |
+
querystring = {'amazon_domain': amazon_domain, 'type': type, 'asin': asin, }
|
| 430 |
+
|
| 431 |
+
headers = {
|
| 432 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 433 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 434 |
+
}
|
| 435 |
+
|
| 436 |
+
|
| 437 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 438 |
+
try:
|
| 439 |
+
observation = response.json()
|
| 440 |
+
except:
|
| 441 |
+
observation = response.text
|
| 442 |
+
return observation
|
| 443 |
+
|
| 444 |
+
def formats_editions(type: str, amazon_domain: str=None, url: str=None, asin: str=None, page: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 445 |
+
"""
|
| 446 |
+
"The Formats & Editions Parameters are applicable when making a request with the type parameter set to type=formats_editions Rainforest API will return data from the Formats & Editions popup (typically shown on books and collectables product pages to list all of the ASINs of different formats of the current ASIN) for the product specified in either the asin and amazon_domain parameters or the url parameter. The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request.
|
| 447 |
+
|
| 448 |
+
Formats & Editions data is retrieved from the Formats & Editions popup for a single product on Amazon"
|
| 449 |
+
amazon_domain:
|
| 450 |
+
The Amazon domain to retrieve Formats & Editions for the product specified in the asin parameter from. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 451 |
+
|
| 452 |
+
Note: If the amazon_domain and asin parameters are supplied then the url parameter is ignored.
|
| 453 |
+
url: The Amazon product-page URL to retrieve Formats & Editions from.
|
| 454 |
+
|
| 455 |
+
Note: If the url parameter is supplied then the amazon_domain and asin parameters are ignor
|
| 456 |
+
asin: The Amazon ASIN (product ID) to retrieve Formats & Editions for. Used in combination with the amazon_domain parameter.
|
| 457 |
+
|
| 458 |
+
Note: If the asin and amazon_domain parameters are supplied then the url parameter is ignored.
|
| 459 |
+
page: The current page of search results to retrieve. Inspect the pagination.total_pages property in the Search results to see how many pages of search results are available.
|
| 460 |
+
|
| 461 |
+
update value of num to get additional pages
|
| 462 |
+
|
| 463 |
+
"""
|
| 464 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 465 |
+
querystring = {'type': type, }
|
| 466 |
+
if amazon_domain:
|
| 467 |
+
querystring['amazon_domain'] = amazon_domain
|
| 468 |
+
if url:
|
| 469 |
+
querystring['url'] = url
|
| 470 |
+
if asin:
|
| 471 |
+
querystring['asin'] = asin
|
| 472 |
+
if page:
|
| 473 |
+
querystring['page'] = page
|
| 474 |
+
|
| 475 |
+
headers = {
|
| 476 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 477 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 478 |
+
}
|
| 479 |
+
|
| 480 |
+
|
| 481 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 482 |
+
try:
|
| 483 |
+
observation = response.json()
|
| 484 |
+
except:
|
| 485 |
+
observation = response.text
|
| 486 |
+
return observation
|
| 487 |
+
|
| 488 |
+
def question_answers(type: str, question_id: str='Tx2YPKCGKAORFA4', page: int=None, amazon_domain: str='amazon.com', customer_location: str=None, url: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 489 |
+
"""
|
| 490 |
+
"The Question Answers Parameters are applicable when making a request with type=question_answers to retrieve all answers for a single question on Amazon - the question is specified using either the question_id and amazon_domain parameters or the url parameter (where the url parameter contains a link to a question answers page). The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request.
|
| 491 |
+
|
| 492 |
+
Question Answers are retrieved from the customer question answers page for a single question on Amazon."
|
| 493 |
+
question_id: The ID of the question to retrieve answers for.
|
| 494 |
+
|
| 495 |
+
Rainforest API returns question_id's from `type=questions` requests in the id parameter. See the questions parameters for further information.
|
| 496 |
+
page: The current page of search results to retrieve. Inspect the pagination.total_pages property in the Search results to see how many pages of search results are available.
|
| 497 |
+
|
| 498 |
+
update value of num to get additional pages
|
| 499 |
+
amazon_domain: The Amazon domain to retrieve answers for the question specified in the question_id parameter from. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 500 |
+
|
| 501 |
+
**Note: If the amazon_domain and question_id parameters are supplied then the url parameter is ignored**.
|
| 502 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 503 |
+
|
| 504 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 505 |
+
|
| 506 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 507 |
+
|
| 508 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. \\\"France\\\" for requests for pages from \\\"amazon.fr\\\".
|
| 509 |
+
|
| 510 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 511 |
+
|
| 512 |
+
See the Request Parameters documentation for more information.
|
| 513 |
+
url: The Amazon product-page URL to retrieve Question Answers from.
|
| 514 |
+
|
| 515 |
+
**Note: If the url parameter is supplied then the amazon_domain and question_id parameters are ignored.**
|
| 516 |
+
|
| 517 |
+
"""
|
| 518 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 519 |
+
querystring = {'type': type, }
|
| 520 |
+
if question_id:
|
| 521 |
+
querystring['question_id'] = question_id
|
| 522 |
+
if page:
|
| 523 |
+
querystring['page'] = page
|
| 524 |
+
if amazon_domain:
|
| 525 |
+
querystring['amazon_domain'] = amazon_domain
|
| 526 |
+
if customer_location:
|
| 527 |
+
querystring['customer_location'] = customer_location
|
| 528 |
+
if url:
|
| 529 |
+
querystring['url'] = url
|
| 530 |
+
|
| 531 |
+
headers = {
|
| 532 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 533 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 534 |
+
}
|
| 535 |
+
|
| 536 |
+
|
| 537 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 538 |
+
try:
|
| 539 |
+
observation = response.json()
|
| 540 |
+
except:
|
| 541 |
+
observation = response.text
|
| 542 |
+
return observation
|
| 543 |
+
|
| 544 |
+
def reviews(type: str, url: str=None, global_reviews: bool=None, review_stars: str=None, sort_by: str=None, search_term: str=None, page: int=None, reviewer_type: str=None, review_media_type: str=None, customer_location: str=None, gtin: str=None, asin: str='B073JYC4XM', amazon_domain: str='amazon.com', review_format: str=None, show_different_asins: bool=None, review_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 545 |
+
"""
|
| 546 |
+
"The Reviews Parameters are applicable when making a request with type=reviews to retrieve customer Reviews for a single product on Amazon - the product is specified using either the asin and amazon_domain parameters or the url parameter (where the url parameter contains a link to an Amazon reviews page). The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request.
|
| 547 |
+
|
| 548 |
+
Reviews are retrieved from the customer reviews page for a single product on Amazon."
|
| 549 |
+
url: The Amazon product-page URL to retrieve Reviews from.
|
| 550 |
+
|
| 551 |
+
**Note: If the url parameter is supplied then the amazon_domain and asin parameters are ignored.**
|
| 552 |
+
global_reviews: Determines whether Global Reviews are included, or not Global Reviews are reviews from other Amazon domains outside of the Amazon domain specified in the request. Valid values are:
|
| 553 |
+
|
| 554 |
+
true
|
| 555 |
+
The default, Global Reviews are included in the results.
|
| 556 |
+
false
|
| 557 |
+
Global reviews are excluded from the results.
|
| 558 |
+
review_stars: The star rating of reviews to retrieve. Valid values are:
|
| 559 |
+
|
| 560 |
+
- all_stars
|
| 561 |
+
- five_star
|
| 562 |
+
- four_star
|
| 563 |
+
- three_star
|
| 564 |
+
- two_star
|
| 565 |
+
- one_star
|
| 566 |
+
- all_positive
|
| 567 |
+
- all_critical
|
| 568 |
+
sort_by: Determines the sort order of reviews to return. Valid values are:
|
| 569 |
+
|
| 570 |
+
- most_helpful
|
| 571 |
+
- most_recent
|
| 572 |
+
search_term: A search term to use to search reviews.
|
| 573 |
+
page: The current page of search results to retrieve. Inspect the `pagination.total_pages` property in the Search results to see how many pages of search results are available.
|
| 574 |
+
|
| 575 |
+
update value of num to get additional pages
|
| 576 |
+
reviewer_type: The type of reviewer to retrieve reviews from. Valid values are:
|
| 577 |
+
|
| 578 |
+
`verified_purchase`
|
| 579 |
+
Include reviews by Amazon Verified Purchasers only.
|
| 580 |
+
`all`
|
| 581 |
+
Include all reviews, regardless of whether they are from Amazon Verified Purchasers or not.
|
| 582 |
+
review_media_type: Filter the reviews to those containing a specific media type. Valid values are:
|
| 583 |
+
|
| 584 |
+
all_reviews
|
| 585 |
+
Include reviews with text, images or video.
|
| 586 |
+
media_reviews_only
|
| 587 |
+
Include only reviews containing images or video.
|
| 588 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 589 |
+
|
| 590 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 591 |
+
|
| 592 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 593 |
+
|
| 594 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. \\\"France\\\" for requests for pages from \\\"amazon.fr\\\".
|
| 595 |
+
|
| 596 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 597 |
+
gtin: A GTIN, ISBN, UPC or EAN code to retrieve results for. Internally Rainforest will first convert the GTIN/ISBN/UPC/EAN to an Amazon ASIN, then retrieve the results for that ASIN from Amazon. Used in combination with the amazon_domain parameter.
|
| 598 |
+
|
| 599 |
+
**Note: If the gtin and amazon_domain parameters are supplied then the url parameter is ignored.**
|
| 600 |
+
asin: The Amazon ASIN (product ID) to retrieve Reviews for. Used in combination with the amazon_domain parameter.
|
| 601 |
+
|
| 602 |
+
**Note: If the asin and amazon_domain parameters are supplied then the url parameter is ignored.**
|
| 603 |
+
amazon_domain: The Amazon domain to retrieve Reviews for the product specified in the asin parameter from. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 604 |
+
|
| 605 |
+
**Note: If the amazon_domain and asin parameters are supplied then the url parameter is ignored.**
|
| 606 |
+
review_format: he type of reviewer to retrieve reviews from. Valid values are:
|
| 607 |
+
|
| 608 |
+
all_formats
|
| 609 |
+
Include reviews of any product format/variant.
|
| 610 |
+
current_format
|
| 611 |
+
Include reviews relating specifically to the current format/variant.
|
| 612 |
+
show_different_asins:
|
| 613 |
+
Sometimes Amazon will return Reviews from ASINs other than the ASIN supplied in the asin request parameter (for example, when the original ASIN is out of stock). show_different_asins controls whether you want these other-ASIN review results returned, or not. Can be set to true (the default) to include reviews from other ASINs, or false to hide reviews from ASINs other than the ASIN supplied in the asin parameter. Note that if you supply a url instead of asin in your request this parameter is ignored.
|
| 614 |
+
|
| 615 |
+
Note in the event of `show_different_asins=false` and the ASIN shown by Amazon being different from the requested ASIN, then all fields apart from product will be removed from the response.
|
| 616 |
+
review_id: A single Review ID, as returned by a prior type=reviews request, to retrieve. Useful if you wish to check for the presence of a single review. Use in combination with the amazon_domain parameter.
|
| 617 |
+
|
| 618 |
+
"""
|
| 619 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 620 |
+
querystring = {'type': type, }
|
| 621 |
+
if url:
|
| 622 |
+
querystring['url'] = url
|
| 623 |
+
if global_reviews:
|
| 624 |
+
querystring['global_reviews'] = global_reviews
|
| 625 |
+
if review_stars:
|
| 626 |
+
querystring['review_stars'] = review_stars
|
| 627 |
+
if sort_by:
|
| 628 |
+
querystring['sort_by'] = sort_by
|
| 629 |
+
if search_term:
|
| 630 |
+
querystring['search_term'] = search_term
|
| 631 |
+
if page:
|
| 632 |
+
querystring['page'] = page
|
| 633 |
+
if reviewer_type:
|
| 634 |
+
querystring['reviewer_type'] = reviewer_type
|
| 635 |
+
if review_media_type:
|
| 636 |
+
querystring['review_media_type'] = review_media_type
|
| 637 |
+
if customer_location:
|
| 638 |
+
querystring['customer_location'] = customer_location
|
| 639 |
+
if gtin:
|
| 640 |
+
querystring['gtin'] = gtin
|
| 641 |
+
if asin:
|
| 642 |
+
querystring['asin'] = asin
|
| 643 |
+
if amazon_domain:
|
| 644 |
+
querystring['amazon_domain'] = amazon_domain
|
| 645 |
+
if review_format:
|
| 646 |
+
querystring['review_format'] = review_format
|
| 647 |
+
if show_different_asins:
|
| 648 |
+
querystring['show_different_asins'] = show_different_asins
|
| 649 |
+
if review_id:
|
| 650 |
+
querystring['review_id'] = review_id
|
| 651 |
+
|
| 652 |
+
headers = {
|
| 653 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 654 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 655 |
+
}
|
| 656 |
+
|
| 657 |
+
|
| 658 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 659 |
+
try:
|
| 660 |
+
observation = response.json()
|
| 661 |
+
except:
|
| 662 |
+
observation = response.text
|
| 663 |
+
return observation
|
| 664 |
+
|
| 665 |
+
def reviewer_comments(asin: str, review_id: str, amazon_domain: str, type: str, sort_by: str=None, customer_location: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 666 |
+
"""
|
| 667 |
+
"The Review Comments Parameters are applicable when making a request with type=review_comments to retrieve customer Review Comments for a single customer review on Amazon - the review is specified using the review_id, asin and amazon_domain parameters. The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request.
|
| 668 |
+
|
| 669 |
+
Review comments are retrieved from the customer reviews page for a single customer review for a single product on Amazon."
|
| 670 |
+
asin: The Amazon ASIN to retrieve Review Comments for. Used in combination with the amazon_domain and review_id parameters.
|
| 671 |
+
review_id: The Review ID, as returned by a type=reviews request, to retrieve Review Comments for. Used in combination with the amazon_domain and asin parameters.
|
| 672 |
+
amazon_domain: The Amazon domain to retrieve Review Comments for the Review ID specified in the review_id parameter and ASIN specified in the asin parameter. For a full list of supported Amazon domains see Supported Amazon Domains. Used in combination with the asin and review_id parameters.
|
| 673 |
+
sort_by: An optional sort order for the returned review comments. Valid values are:
|
| 674 |
+
|
| 675 |
+
- most_recent
|
| 676 |
+
- oldest
|
| 677 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 678 |
+
|
| 679 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 680 |
+
|
| 681 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 682 |
+
|
| 683 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. \\\"France\\\" for requests for pages from \\\"amazon.fr\\\".
|
| 684 |
+
|
| 685 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 686 |
+
|
| 687 |
+
See the Request Parameters documentation for more information.
|
| 688 |
+
|
| 689 |
+
"""
|
| 690 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 691 |
+
querystring = {'asin': asin, 'review_id': review_id, 'amazon_domain': amazon_domain, 'type': type, }
|
| 692 |
+
if sort_by:
|
| 693 |
+
querystring['sort_by'] = sort_by
|
| 694 |
+
if customer_location:
|
| 695 |
+
querystring['customer_location'] = customer_location
|
| 696 |
+
|
| 697 |
+
headers = {
|
| 698 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 699 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 700 |
+
}
|
| 701 |
+
|
| 702 |
+
|
| 703 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 704 |
+
try:
|
| 705 |
+
observation = response.json()
|
| 706 |
+
except:
|
| 707 |
+
observation = response.text
|
| 708 |
+
return observation
|
| 709 |
+
|
| 710 |
+
def wishlist(type: str, url: str=None, amazon_domain: str='amazon.com', wishlist_id: str='38B3V3AT7UH9B', sort_by: str=None, next_page_token: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 711 |
+
"""
|
| 712 |
+
"The Wishlist Parameters are applicable when making a request with the type parameter set to type=wishlist Rainforest API will return data from the Wishlist page for the wishlist specified in either the wishlist_id and amazon_domain parameters or the url parameter. The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request.
|
| 713 |
+
|
| 714 |
+
Wishlist data is retrieved from the Wishlist popup."
|
| 715 |
+
url:
|
| 716 |
+
The Amazon wishlist-page URL to retrieve Wishlist results from.
|
| 717 |
+
|
| 718 |
+
Note: If the url parameter is supplied then the amazon_domain and wishlist_url parameters are ignored.
|
| 719 |
+
amazon_domain:
|
| 720 |
+
The Amazon domain to retrieve Wishlist for the product specified in the asin parameter from. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 721 |
+
|
| 722 |
+
Note: If the amazon_domain and asin parameters are supplied then the url parameter is ignored.
|
| 723 |
+
wishlist_id:
|
| 724 |
+
The Amazon wishlist ID to retrieve Wishlist results for. Used in combination with the amazon_domain parameter. The wishlist ID can be found in any Amazon wishlist URL after the /ls/ component of the wishlist URL.
|
| 725 |
+
|
| 726 |
+
Note: If the wishlist_id and amazon_domain parameters are supplied then the url parameter is ignored.
|
| 727 |
+
sort_by:
|
| 728 |
+
Determines the sort order of wishlist items to return. Omit the sort_by parameter to return results in the default sort order. Valid values are:
|
| 729 |
+
price_high_to_low
|
| 730 |
+
Returns highest priced wishlist items first.
|
| 731 |
+
price_low_to_high
|
| 732 |
+
Returns lowest priced wishlist items first.
|
| 733 |
+
priority_high_to_low
|
| 734 |
+
Returns highest priority wishlist items first.
|
| 735 |
+
next_page_token: the current page of Wishlist results to retrieve. Inspect the pagination.next_page_token property in the Wishlist results to retrieve the next_page_token of the subsequent page.
|
| 736 |
+
|
| 737 |
+
"""
|
| 738 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 739 |
+
querystring = {'type': type, }
|
| 740 |
+
if url:
|
| 741 |
+
querystring['url'] = url
|
| 742 |
+
if amazon_domain:
|
| 743 |
+
querystring['amazon_domain'] = amazon_domain
|
| 744 |
+
if wishlist_id:
|
| 745 |
+
querystring['wishlist_id'] = wishlist_id
|
| 746 |
+
if sort_by:
|
| 747 |
+
querystring['sort_by'] = sort_by
|
| 748 |
+
if next_page_token:
|
| 749 |
+
querystring['next_page_token'] = next_page_token
|
| 750 |
+
|
| 751 |
+
headers = {
|
| 752 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 753 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 754 |
+
}
|
| 755 |
+
|
| 756 |
+
|
| 757 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 758 |
+
try:
|
| 759 |
+
observation = response.json()
|
| 760 |
+
except:
|
| 761 |
+
observation = response.text
|
| 762 |
+
return observation
|
| 763 |
+
|
| 764 |
+
def charts(type: str, url: str='https://www.amazon.com/charts', customer_location: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 765 |
+
"""
|
| 766 |
+
"The Charts parameters are applicable when making a request with type=charts to retrieve Charts results. The Charts page can be specified using the url parameter. The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request.
|
| 767 |
+
|
| 768 |
+
Charts results are retrieved from the charts page on Amazon."
|
| 769 |
+
url: The Charts page URL to retrieve Charts results from. Be sure to URL-encode the url parameter.
|
| 770 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 771 |
+
|
| 772 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 773 |
+
|
| 774 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 775 |
+
|
| 776 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. \"France\" for requests for pages from \"amazon.fr\".
|
| 777 |
+
|
| 778 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 779 |
+
|
| 780 |
+
See the Request Parameters documentation for more information.
|
| 781 |
+
|
| 782 |
+
"""
|
| 783 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 784 |
+
querystring = {'type': type, }
|
| 785 |
+
if url:
|
| 786 |
+
querystring['url'] = url
|
| 787 |
+
if customer_location:
|
| 788 |
+
querystring['customer_location'] = customer_location
|
| 789 |
+
|
| 790 |
+
headers = {
|
| 791 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 792 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 793 |
+
}
|
| 794 |
+
|
| 795 |
+
|
| 796 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 797 |
+
try:
|
| 798 |
+
observation = response.json()
|
| 799 |
+
except:
|
| 800 |
+
observation = response.text
|
| 801 |
+
return observation
|
| 802 |
+
|
| 803 |
+
def store(type: str, page: str=None, amazon_domain: str='amazon.com', store_id: str='70F3122D-4966-4242-A8A6-871C8D7E6F8B', url: str=None, customer_location: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 804 |
+
"""
|
| 805 |
+
"The Store parameters are applicable when making a request with type=store to retrieve Brand Store results for a Brand Store. The Brand Store can be specified either by the url parameter, or by a combination of the store_id and amazon_domain parameters. The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request."
|
| 806 |
+
page: The current page of search results to retrieve. Inspect the pagination.total_pages property in the Search results to see how many pages of search results are available.
|
| 807 |
+
|
| 808 |
+
update value of num to get additional pages
|
| 809 |
+
amazon_domain:
|
| 810 |
+
The Amazon domain to retrieve Brand Store results from. For a full list of supported Amazon domains see Supported Amazon Domains. Should be used in combination with the store_id parameter.
|
| 811 |
+
|
| 812 |
+
Note if the url parameter is supplied then the amazon_domain parameter is ignored as the url itself specifies the Amazon domain.
|
| 813 |
+
store_id:
|
| 814 |
+
A Brand Store ID to retrieve results from. Should be used in combination with the amazon_domain parameter.
|
| 815 |
+
|
| 816 |
+
Note if the url parameter is supplied then the store_id parameter is ignored as the url itself specifies the store ID.
|
| 817 |
+
url:
|
| 818 |
+
The Brand Store page URL to retrieve Brand Store results from. Be sure to URL-encode the url parameter.
|
| 819 |
+
|
| 820 |
+
Note the url parameter is supplied, the store_id and amazon_domain parameters cannot be used (as the url itself defines the Store ID and Amazon domain used).
|
| 821 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 822 |
+
|
| 823 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 824 |
+
|
| 825 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 826 |
+
|
| 827 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. \"France\" for requests for pages from \"amazon.fr\".
|
| 828 |
+
|
| 829 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 830 |
+
|
| 831 |
+
See the Request Parameters documentation for more information.
|
| 832 |
+
|
| 833 |
+
"""
|
| 834 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 835 |
+
querystring = {'type': type, }
|
| 836 |
+
if page:
|
| 837 |
+
querystring['page'] = page
|
| 838 |
+
if amazon_domain:
|
| 839 |
+
querystring['amazon_domain'] = amazon_domain
|
| 840 |
+
if store_id:
|
| 841 |
+
querystring['store_id'] = store_id
|
| 842 |
+
if url:
|
| 843 |
+
querystring['url'] = url
|
| 844 |
+
if customer_location:
|
| 845 |
+
querystring['customer_location'] = customer_location
|
| 846 |
+
|
| 847 |
+
headers = {
|
| 848 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 849 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 850 |
+
}
|
| 851 |
+
|
| 852 |
+
|
| 853 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 854 |
+
try:
|
| 855 |
+
observation = response.json()
|
| 856 |
+
except:
|
| 857 |
+
observation = response.text
|
| 858 |
+
return observation
|
| 859 |
+
|
| 860 |
+
def seller_products(type: str, url: str=None, amazon_domain: str='amazon.com', seller_id: str='A02211013Q5HP3OMSZC7W', refinements: str=None, page: int=None, customer_location: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 861 |
+
"""
|
| 862 |
+
"The Seller Products Parameters are applicable when making a request with type=seller_products to retrieve seller product listing results for a single seller on Amazon - the seller is specified using either the seller_id and amazon_domain parameters or the url parameter (where the url parameter contains a link to an Amazon seller product listing page). The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request.
|
| 863 |
+
|
| 864 |
+
Seller product listing results are retrieved from the seller product listings page for a single seller on Amazon. You can retrieve the seller_id value for a given seller from other Rainforest requests, such as type=offers requests."
|
| 865 |
+
url: The Amazon seller products listing page URL to retrieve seller products results from.
|
| 866 |
+
|
| 867 |
+
amazon_domain:
|
| 868 |
+
The Amazon domain to retrieve seller product listings from for the seller specified in the seller_id parameter. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 869 |
+
|
| 870 |
+
Note: If the amazon_domain and seller_id parameters are supplied then the url parameter is ignored.
|
| 871 |
+
seller_id: The Amazon Seller ID to retrieve seller product listings for. Used in combination with the amazon_domain parameter.
|
| 872 |
+
|
| 873 |
+
Note: If the seller_id and amazon_domain parameters are supplied then the url parameter is ignored. Note: Seller IDs can be retrieved from Rainforest API type=offers requests.
|
| 874 |
+
refinements:
|
| 875 |
+
A comma-seperated list of refinement values to filter the seller product results by. These allow you to refine your request by values such as \\\\\\\\\\\\\\\"Reviews rating 4 and over\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"price range\\\\\\\\\\\\\\\" and \\\\\\\\\\\\\\\"brand\\\\\\\\\\\\\\\".
|
| 876 |
+
|
| 877 |
+
Refinement values are returned in the refinements array of each type=seller_products result (if they are displayed). Refinement values are dynamic and change by seller. If you wish to use refinements you should first issue a type=seller_products request without specifying any refinements to retrieve a master list of the avaialble refinements for the given request. You can then cache these refinement values for use on subsequent requests.
|
| 878 |
+
|
| 879 |
+
For example, to run a type=seller_products request specifying two refinements with values p_85/2470955011 and p_36/2421886011 the value of the refinements parameter would be refinements=p_85/2470955011,p_36/2421886011
|
| 880 |
+
page: The current page of search results to retrieve. Inspect the pagination.total_pages property in the Search results to see how many pages of search results are available.
|
| 881 |
+
|
| 882 |
+
update value of num to get additional pages
|
| 883 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 884 |
+
|
| 885 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 886 |
+
|
| 887 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 888 |
+
|
| 889 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. \"France\" for requests for pages from \"amazon.fr\".
|
| 890 |
+
|
| 891 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 892 |
+
|
| 893 |
+
See the Request Parameters documentation for more information.
|
| 894 |
+
|
| 895 |
+
"""
|
| 896 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 897 |
+
querystring = {'type': type, }
|
| 898 |
+
if url:
|
| 899 |
+
querystring['url'] = url
|
| 900 |
+
if amazon_domain:
|
| 901 |
+
querystring['amazon_domain'] = amazon_domain
|
| 902 |
+
if seller_id:
|
| 903 |
+
querystring['seller_id'] = seller_id
|
| 904 |
+
if refinements:
|
| 905 |
+
querystring['refinements'] = refinements
|
| 906 |
+
if page:
|
| 907 |
+
querystring['page'] = page
|
| 908 |
+
if customer_location:
|
| 909 |
+
querystring['customer_location'] = customer_location
|
| 910 |
+
|
| 911 |
+
headers = {
|
| 912 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 913 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 914 |
+
}
|
| 915 |
+
|
| 916 |
+
|
| 917 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 918 |
+
try:
|
| 919 |
+
observation = response.json()
|
| 920 |
+
except:
|
| 921 |
+
observation = response.text
|
| 922 |
+
return observation
|
| 923 |
+
|
| 924 |
+
def seller_feedback(type: str, amazon_domain: str='amazon.com', page: int=None, seller_id: str='A02211013Q5HP3OMSZC7W', customer_location: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 925 |
+
"""
|
| 926 |
+
"The Seller Feedback Parameters are applicable when making a request with type=seller_feedback to retrieve seller customer feedback details for a seller on Amazon - the seller is specified using the seller_id and amazon_domain parameters. The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request.
|
| 927 |
+
|
| 928 |
+
Seller feedback details are retrieved from the feedback section of the seller profile page. You can retrieve the seller_id value for a given seller from other Rainforest requests, such as type=offers requests.
|
| 929 |
+
|
| 930 |
+
A maximum of 5 seller feedback records can be returned per request. You can paginate through multiple pages of seller feedback records using the page parameter. Inspect the pagination.has_next_page property to determine whether there is a next page of results to retrieve."
|
| 931 |
+
amazon_domain: The Amazon domain to retrieve seller feedback results from for the seller specified in the seller_id parameter. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 932 |
+
page: The current page of search results to retrieve. Inspect the pagination.total_pages property in the Search results to see how many pages of search results are available.
|
| 933 |
+
|
| 934 |
+
update value of num to get additional pages
|
| 935 |
+
seller_id:
|
| 936 |
+
The Amazon Seller ID to retrieve seller feedback results for. Used in combination with the amazon_domain parameter.
|
| 937 |
+
|
| 938 |
+
Note: Seller IDs can be retrieved from Rainforest API type=offers re
|
| 939 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 940 |
+
|
| 941 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 942 |
+
|
| 943 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 944 |
+
|
| 945 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. \"France\" for requests for pages from \"amazon.fr\".
|
| 946 |
+
|
| 947 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 948 |
+
|
| 949 |
+
See the Request Parameters documentation for more information.
|
| 950 |
+
|
| 951 |
+
"""
|
| 952 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 953 |
+
querystring = {'type': type, }
|
| 954 |
+
if amazon_domain:
|
| 955 |
+
querystring['amazon_domain'] = amazon_domain
|
| 956 |
+
if page:
|
| 957 |
+
querystring['page'] = page
|
| 958 |
+
if seller_id:
|
| 959 |
+
querystring['seller_id'] = seller_id
|
| 960 |
+
if customer_location:
|
| 961 |
+
querystring['customer_location'] = customer_location
|
| 962 |
+
|
| 963 |
+
headers = {
|
| 964 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 965 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 966 |
+
}
|
| 967 |
+
|
| 968 |
+
|
| 969 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 970 |
+
try:
|
| 971 |
+
observation = response.json()
|
| 972 |
+
except:
|
| 973 |
+
observation = response.text
|
| 974 |
+
return observation
|
| 975 |
+
|
| 976 |
+
def seller_profile(type: str, url: str=None, seller_id: str='A02211013Q5HP3OMSZC7W', amazon_domain: str='amazon.com', customer_location: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 977 |
+
"""
|
| 978 |
+
"The Seller Profile Parameters are applicable when making a request with type=seller_profile to retrieve seller profile details for a single seller on Amazon - the seller is specified using either the seller_id and amazon_domain parameters or the url parameter (where the url parameter contains a link to an Amazon seller profile page). The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request.
|
| 979 |
+
|
| 980 |
+
Seller profile details are retrieved from the seller profile page for a single seller on Amazon. You can retrieve the seller_id value for a given seller from other Rainforest requests, such as type=offers requests.
|
| 981 |
+
|
| 982 |
+
You can use subsequent seller products and seller feedback requests to retrieve iterate all of the products and customer feedback from a given seller."
|
| 983 |
+
url: The Amazon seller profile page URL of the seller to retrieve results from.
|
| 984 |
+
|
| 985 |
+
seller_id: The Amazon Seller ID to retrieve seller profile details for. Used in combination with the amazon_domain parameter.
|
| 986 |
+
|
| 987 |
+
Note: If the seller_id and amazon_domain parameters are supplied then the url parameter is ignored. Note: Seller IDs can be retrieved from Rainforest API type=offers requests.
|
| 988 |
+
amazon_domain: The Amazon domain to retrieve seller profile details from for the seller specified in the seller_id parameter. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 989 |
+
|
| 990 |
+
Note: If the amazon_domain and seller_id parameters are supplied then the url parameter is ignored.
|
| 991 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 992 |
+
|
| 993 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 994 |
+
|
| 995 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 996 |
+
|
| 997 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. \"France\" for requests for pages from \"amazon.fr\".
|
| 998 |
+
|
| 999 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 1000 |
+
|
| 1001 |
+
See the Request Parameters documentation for more information.
|
| 1002 |
+
|
| 1003 |
+
"""
|
| 1004 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 1005 |
+
querystring = {'type': type, }
|
| 1006 |
+
if url:
|
| 1007 |
+
querystring['url'] = url
|
| 1008 |
+
if seller_id:
|
| 1009 |
+
querystring['seller_id'] = seller_id
|
| 1010 |
+
if amazon_domain:
|
| 1011 |
+
querystring['amazon_domain'] = amazon_domain
|
| 1012 |
+
if customer_location:
|
| 1013 |
+
querystring['customer_location'] = customer_location
|
| 1014 |
+
|
| 1015 |
+
headers = {
|
| 1016 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 1017 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 1018 |
+
}
|
| 1019 |
+
|
| 1020 |
+
|
| 1021 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 1022 |
+
try:
|
| 1023 |
+
observation = response.json()
|
| 1024 |
+
except:
|
| 1025 |
+
observation = response.text
|
| 1026 |
+
return observation
|
| 1027 |
+
|
| 1028 |
+
def reviewer_profile(type: str, reviewer_profile_pages: str=None, url: str=None, amazon_domain: str='amazon.com', reviewer_id: str='AHBEI6Q4F4WHRIFK5CWQMRVPOQMA', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 1029 |
+
"""
|
| 1030 |
+
"When making a request with the type parameter set to type=reviewer_profile Rainforest API will return details of reviewer specified in either the reviewer_id and amazon_domain parameters or the url parameter.
|
| 1031 |
+
|
| 1032 |
+
Reviewer profile details are retrieved from the reviewer profile page. You can retrieve the reviewer_id value for a given reviewer from other Rainforest requests, such as type=reviews requests."
|
| 1033 |
+
reviewer_profile_pages: The number of pages of reviews to retrieve from the reviewer profile page when `type=reviewer_profile`.
|
| 1034 |
+
|
| 1035 |
+
This parameter is different from the more usual page parameter as pagination of reviewer profile reviews is performed from an infinate-scrolling list.
|
| 1036 |
+
|
| 1037 |
+
It is not possible to \\\"go to page 3\\\", so the reviewer_profile_pages allows you retrieve \\\"the first X\\\" pages of reviews (a maximum of 10 reviews are returned per page).
|
| 1038 |
+
|
| 1039 |
+
Note: that using reviewer_profile_pages decrements a credit for each page of reviews retrieved, for example, reviewer_profile_pages=3 would decrement 3 credits from your balance.
|
| 1040 |
+
url: The Amazon reviewer profile page URL of the reviewer to retrieve results from.
|
| 1041 |
+
amazon_domain: The Amazon domain to retrieve reviewer profile details from for the reviewer specified in the reviewer_id parameter. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 1042 |
+
|
| 1043 |
+
**Note: If the amazon_domain and reviewer_id parameters are supplied then the url parameter is ignored.**
|
| 1044 |
+
reviewer_id: The Amazon Reviewer ID to retrieve reviewer profile details for. Used in combination with the amazon_domain parameter.
|
| 1045 |
+
|
| 1046 |
+
**Note: If the reviewer_id and amazon_domain parameters are supplied then the url parameter is ignored. Reviewer IDs can be retrieved from other Rainforest API requests, for example `type=reviews requests`.**
|
| 1047 |
+
|
| 1048 |
+
"""
|
| 1049 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 1050 |
+
querystring = {'type': type, }
|
| 1051 |
+
if reviewer_profile_pages:
|
| 1052 |
+
querystring['reviewer_profile_pages'] = reviewer_profile_pages
|
| 1053 |
+
if url:
|
| 1054 |
+
querystring['url'] = url
|
| 1055 |
+
if amazon_domain:
|
| 1056 |
+
querystring['amazon_domain'] = amazon_domain
|
| 1057 |
+
if reviewer_id:
|
| 1058 |
+
querystring['reviewer_id'] = reviewer_id
|
| 1059 |
+
|
| 1060 |
+
headers = {
|
| 1061 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 1062 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 1063 |
+
}
|
| 1064 |
+
|
| 1065 |
+
|
| 1066 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 1067 |
+
try:
|
| 1068 |
+
observation = response.json()
|
| 1069 |
+
except:
|
| 1070 |
+
observation = response.text
|
| 1071 |
+
return observation
|
| 1072 |
+
|
| 1073 |
+
def bestsellers(type: str, url: str=None, page: int=2, amazon_domain: str='amazon.com', category_id: str='bestsellers_appliances', top_free: bool=None, customer_location: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 1074 |
+
"""
|
| 1075 |
+
"The Bestsellers Parameters are applicable when making a request with type=bestsellers to retrieve Bestseller results from an Amazon bestsellers page - the bestsellers page is specified either using the category_id and amazon_domain parameters (where category_id is a Category ID returned from the Categories API, or by using the url parameter. The parameters should be appended as querystring parameters to the Product Data API GET HTTP request.
|
| 1076 |
+
|
| 1077 |
+
Note that, if using the url parameter it should be url-encoded.
|
| 1078 |
+
|
| 1079 |
+
Bestsellers results are retrieved from the bestsellers listing page on Amazon. Rainforest supports all types of Amazon Bestseller pages, bestsellers, new releases, movers & shakers, most wished for and gift ideas."
|
| 1080 |
+
url: The Amazon Bestsellesr results page URL to retrieve bestsellers results from.
|
| 1081 |
+
|
| 1082 |
+
**Note: The url parameter should be url-encoded.**
|
| 1083 |
+
|
| 1084 |
+
Note: Either the url or category_id & amazon_domain parameters can be used.
|
| 1085 |
+
page: The current page of search results to retrieve. Inspect the pagination.total_pages property in the Search results to see how many pages of search results are available.
|
| 1086 |
+
|
| 1087 |
+
update value of num to get additional pages
|
| 1088 |
+
amazon_domain: The Amazon domain to retrieve bestsellers results from. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 1089 |
+
category_id: A category ID to retrieve bestsellers results from. You must supply a category_id returned from the Categories API in to the category_id parameter.
|
| 1090 |
+
top_free: Set to true to retrieve the \\\\\\\\\\\\\\\"Top 100 Free\\\\\\\\\\\\\\\" version of the specified Bestsellers category_id or url. See screenshot below for how the Top 100 Paid / Top 100 Free bestsellers for a given category are displayed on the Amazon site.
|
| 1091 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 1092 |
+
|
| 1093 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 1094 |
+
|
| 1095 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 1096 |
+
|
| 1097 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. \\\"France\\\" for requests for pages from \\\"amazon.fr\\\".
|
| 1098 |
+
|
| 1099 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 1100 |
+
|
| 1101 |
+
See the Request Parameters documentation for more information.
|
| 1102 |
+
|
| 1103 |
+
"""
|
| 1104 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 1105 |
+
querystring = {'type': type, }
|
| 1106 |
+
if url:
|
| 1107 |
+
querystring['url'] = url
|
| 1108 |
+
if page:
|
| 1109 |
+
querystring['page'] = page
|
| 1110 |
+
if amazon_domain:
|
| 1111 |
+
querystring['amazon_domain'] = amazon_domain
|
| 1112 |
+
if category_id:
|
| 1113 |
+
querystring['category_id'] = category_id
|
| 1114 |
+
if top_free:
|
| 1115 |
+
querystring['top_free'] = top_free
|
| 1116 |
+
if customer_location:
|
| 1117 |
+
querystring['customer_location'] = customer_location
|
| 1118 |
+
|
| 1119 |
+
headers = {
|
| 1120 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 1121 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 1122 |
+
}
|
| 1123 |
+
|
| 1124 |
+
|
| 1125 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 1126 |
+
try:
|
| 1127 |
+
observation = response.json()
|
| 1128 |
+
except:
|
| 1129 |
+
observation = response.text
|
| 1130 |
+
return observation
|
| 1131 |
+
|
| 1132 |
+
def category(type: str, amazon_domain: str='amazon.com', url: str=None, category_id: str='2619526011', refinements: str=None, sort_by: str='average_review', page: int=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 1133 |
+
"""
|
| 1134 |
+
"The Category Parameters are applicable when making a request with type=category to retrieve category results for an Amazon category. Categories can be specified either via passing an Amazon category URL in to the url parameter, or by passing a Category ID in to the category_id (where the category_id is returned from the Categories API) and an Amazon domain in to the amazon_domain parameter. The parameters should be appended as querystring parameters to the Product Data APIGETHTTP request."
|
| 1135 |
+
amazon_domain: The Amazon domain to retrieve category results from. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 1136 |
+
url: The Amazon category results page URL to retrieve category results from. Be sure to URL-encode the url parameter.
|
| 1137 |
+
|
| 1138 |
+
Note the url parameter is supplied, the category_id parameter cannot be used (as the url itself defines the category ID used).
|
| 1139 |
+
category_id:
|
| 1140 |
+
A category ID to retrieve results from. You may supply any arbitary value in the category_id parameter however we recommend using a category ID returned from the Categories API as these are known-good category IDs from Amazon.
|
| 1141 |
+
|
| 1142 |
+
Rainforest will use the category_id in the following form: https://amazon_domain/s?node=category_id.
|
| 1143 |
+
|
| 1144 |
+
Note that pagination for top-level categories is not supported by the Amazon sites. If you wish to iterate the contents of a category the recommended approach is to pick the lowest level categories to perform your iteration / pagination on.
|
| 1145 |
+
refinements: A comma-seperated list of refinement values to filter the category results by. These allow you to refine your category results by values such as \\\\\\\\\\\\\\\"Reviews rating 4 and over\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"price range\\\\\\\\\\\\\\\" and \\\\\\\\\\\\\\\"brand\\\\\\\\\\\\\\\".
|
| 1146 |
+
|
| 1147 |
+
Refinement values are returned in the refinements array of each type=category result. Refinement values are dynamic and change by category area or search term used. If you wish to use refinements you should first issue a type=category request without specifying any refinements to retrieve a master list of the avaialble refinements for the given category area/search term. You can then cache these refinement values for use on subsequent requests.
|
| 1148 |
+
|
| 1149 |
+
For example, to run a type=search request specifying two refinements with values p_85/2470955011 and p_36/2421886011 the value of the refinements parameter would be refinements=p_85/2470955011,p_36/2421886011
|
| 1150 |
+
|
| 1151 |
+
Note that sometimes Amazon do not present a explicit refinement value and instead a link is returned. In this instance you should pass the link into the url request parameter of your type=category request to retrieve data from that refinement-filtered page.
|
| 1152 |
+
|
| 1153 |
+
sort_by: Determines the sort order of category results to return. Valid values are:
|
| 1154 |
+
most_recent
|
| 1155 |
+
Sort category results by newest arrivals.
|
| 1156 |
+
price_low_to_high
|
| 1157 |
+
Sort category results by lowest to highest price.
|
| 1158 |
+
price_high_to_low
|
| 1159 |
+
Sort category results by highest to lowest price.
|
| 1160 |
+
featured
|
| 1161 |
+
Sort category results by featured first.
|
| 1162 |
+
average_review
|
| 1163 |
+
Sort category results by average customer review.
|
| 1164 |
+
page: The current page of search results to retrieve. Inspect the pagination.total_pages property in the Search results to see how many pages of search results are available.
|
| 1165 |
+
|
| 1166 |
+
update value of num to get additional pages
|
| 1167 |
+
|
| 1168 |
+
"""
|
| 1169 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 1170 |
+
querystring = {'type': type, }
|
| 1171 |
+
if amazon_domain:
|
| 1172 |
+
querystring['amazon_domain'] = amazon_domain
|
| 1173 |
+
if url:
|
| 1174 |
+
querystring['url'] = url
|
| 1175 |
+
if category_id:
|
| 1176 |
+
querystring['category_id'] = category_id
|
| 1177 |
+
if refinements:
|
| 1178 |
+
querystring['refinements'] = refinements
|
| 1179 |
+
if sort_by:
|
| 1180 |
+
querystring['sort_by'] = sort_by
|
| 1181 |
+
if page:
|
| 1182 |
+
querystring['page'] = page
|
| 1183 |
+
|
| 1184 |
+
headers = {
|
| 1185 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 1186 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 1187 |
+
}
|
| 1188 |
+
|
| 1189 |
+
|
| 1190 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 1191 |
+
try:
|
| 1192 |
+
observation = response.json()
|
| 1193 |
+
except:
|
| 1194 |
+
observation = response.text
|
| 1195 |
+
return observation
|
| 1196 |
+
|
| 1197 |
+
def search(type: str, sort_by: str='featured', refinements: str=None, url: str=None, search_term: str='hiking backpack', amazon_domain: str='amazon.com', page: int=None, category_id: str=None, customer_location: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 1198 |
+
"""
|
| 1199 |
+
"The Search Parameters are applicable when making a request with type=search to retrieve search results for an Amazon domain - the Amazon domain is specified using the amazon_domain parameter and the search term is specified in the search_term parameter. The parameters should be appended as querystring parameters to the Product Data API GET HTTP request."
|
| 1200 |
+
sort_by: Determines the sort order of search results to return. Valid values are:
|
| 1201 |
+
|
| 1202 |
+
- most_recent
|
| 1203 |
+
- price_low_to_high
|
| 1204 |
+
- price_high_to_low
|
| 1205 |
+
- featured
|
| 1206 |
+
- average_review
|
| 1207 |
+
-
|
| 1208 |
+
|
| 1209 |
+
relevance
|
| 1210 |
+
- Sort search results by most relevant first.
|
| 1211 |
+
- Applies only to Audible Amazon Domains.
|
| 1212 |
+
|
| 1213 |
+
bestsellers
|
| 1214 |
+
- Sort search results by best sellers first.
|
| 1215 |
+
- Applies only to Audible Amazon Domains.
|
| 1216 |
+
|
| 1217 |
+
running_time_ascending
|
| 1218 |
+
- Sort search results by shortest running time first, from short to long.
|
| 1219 |
+
- Applies only to Audible Amazon Domains.
|
| 1220 |
+
|
| 1221 |
+
running_time_descending
|
| 1222 |
+
- Sort search results by shortest running time first, from long to short.
|
| 1223 |
+
- Applies only to Audible Amazon Domains.
|
| 1224 |
+
|
| 1225 |
+
title_ascending
|
| 1226 |
+
- Sort search results alphabetically by title from A to Z.
|
| 1227 |
+
- Applies only to Audible Amazon Domains.
|
| 1228 |
+
|
| 1229 |
+
title_descending
|
| 1230 |
+
- Sort search results alphabetically by title from Z to A.
|
| 1231 |
+
- Applies only to Audible Amazon Domains.
|
| 1232 |
+
refinements: A comma-seperated list of refinement values to filter the search results by. These allow you to refine your search by values such as \"Reviews rating 4 and over\", \"price range\" and \"brand\".
|
| 1233 |
+
|
| 1234 |
+
Refinement values are returned in the refinements array of each type=search result. Refinement values are dynamic and change by category area or search term used. If you wish to use refinements you should first issue a `type=search` request without specifying any refinements to retrieve a master list of the avaialble refinements for the given category area/search term. You can then cache these refinement values for use on subsequent requests.
|
| 1235 |
+
|
| 1236 |
+
For example, to run a `type=search` request specifying two refinements with values `p_85/2470955011 `and `p_36/2421886011` the value of the refinements parameter would be `refinements=p_85/2470955011,p_36/2421886011`
|
| 1237 |
+
url: The Amazon search results page URL to retrieve search results from. Be sure to URL-encode the url parameter.
|
| 1238 |
+
|
| 1239 |
+
**Note the url parameter is supplied, the search_term parameter cannot be used (as the url itself defines the search term used).**
|
| 1240 |
+
search_term: A search term to use to search products.
|
| 1241 |
+
amazon_domain: The Amazon domain to retrieve search results from. For a full list of supported Amazon domains see [Supported Amazon Domains](https://www.rainforestapi.com/docs/product-data-api/reference/amazon-domains).
|
| 1242 |
+
|
| 1243 |
+
**Note: If the amazon_domain and asin parameters are supplied then the url parameter is ignored.**
|
| 1244 |
+
page: The current page of search results to retrieve. Inspect the pagination.total_pages property in the Search results to see how many pages of search results are available.
|
| 1245 |
+
|
| 1246 |
+
update value of num to get additional pages
|
| 1247 |
+
category_id: A category ID to limit search results to. You may supply any arbitary value in the category_id parameter however we recommend using a category ID returned from the Categories API as these are known-good category IDs from Amazon.
|
| 1248 |
+
|
| 1249 |
+
Rainforest will use the category_id in the following form: `https://amazon_domain/s?node=category_id.`
|
| 1250 |
+
|
| 1251 |
+
Note that pagination for top-level categories is not supported by the Amazon sites. If you wish to iterate the contents of a category the recommended approach is to pick the lowest level categories to perform your iteration / pagination on.
|
| 1252 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 1253 |
+
|
| 1254 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 1255 |
+
|
| 1256 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 1257 |
+
|
| 1258 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. \\\"France\\\" for requests for pages from \\\"amazon.fr\\\".
|
| 1259 |
+
|
| 1260 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 1261 |
+
|
| 1262 |
+
See the Request Parameters documentation for more information.
|
| 1263 |
+
|
| 1264 |
+
"""
|
| 1265 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 1266 |
+
querystring = {'type': type, }
|
| 1267 |
+
if sort_by:
|
| 1268 |
+
querystring['sort_by'] = sort_by
|
| 1269 |
+
if refinements:
|
| 1270 |
+
querystring['refinements'] = refinements
|
| 1271 |
+
if url:
|
| 1272 |
+
querystring['url'] = url
|
| 1273 |
+
if search_term:
|
| 1274 |
+
querystring['search_term'] = search_term
|
| 1275 |
+
if amazon_domain:
|
| 1276 |
+
querystring['amazon_domain'] = amazon_domain
|
| 1277 |
+
if page:
|
| 1278 |
+
querystring['page'] = page
|
| 1279 |
+
if category_id:
|
| 1280 |
+
querystring['category_id'] = category_id
|
| 1281 |
+
if customer_location:
|
| 1282 |
+
querystring['customer_location'] = customer_location
|
| 1283 |
+
|
| 1284 |
+
headers = {
|
| 1285 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 1286 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 1287 |
+
}
|
| 1288 |
+
|
| 1289 |
+
|
| 1290 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 1291 |
+
try:
|
| 1292 |
+
observation = response.json()
|
| 1293 |
+
except:
|
| 1294 |
+
observation = response.text
|
| 1295 |
+
return observation
|
| 1296 |
+
|
| 1297 |
+
def single_product(type: str, url: str=None, amazon_domain: str='amazon.com', gtin: str=None, asin: str='B073JYC4XM', customer_location: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 1298 |
+
"""
|
| 1299 |
+
"The Product Parameters are applicable when making a request with type=product to retrieve details of a single product on Amazon - the product is specified using either the asin and amazon_domain parameters or the url parameter (where the url parameter contains a link to an Amazon product page). The parameters should be appended as querystring parameters to the Product Data API GET HTTP request"
|
| 1300 |
+
url: The Amazon product-page URL to retrieve product details from.
|
| 1301 |
+
|
| 1302 |
+
**Ensure that the url parameter is URL-encoded.**
|
| 1303 |
+
|
| 1304 |
+
Note: If the url parameter is supplied then the amazon_domain and asin parameters are ignored.
|
| 1305 |
+
amazon_domain: The Amazon domain to retrieve product details from for the product specified in the asin parameter. For a full list of supported Amazon domains see Supported Amazon Domains.
|
| 1306 |
+
|
| 1307 |
+
**Note: If the amazon_domain and asin parameters are supplied then the url parameter is ignored.**
|
| 1308 |
+
gtin: A GTIN, ISBN, UPC or EAN code to retrieve results for. Internally Rainforest will first convert the GTIN/ISBN/UPC/EAN to an Amazon ASIN, then retrieve the results for that ASIN from Amazon. Used in combination with the amazon_domain parameter.
|
| 1309 |
+
|
| 1310 |
+
**Note: If the gtin and amazon_domain parameters are supplied then the url parameter is ignored.**
|
| 1311 |
+
asin: The Amazon ASIN (product ID) to retrieve product details for. Used in combination with the amazon_domain parameter.
|
| 1312 |
+
|
| 1313 |
+
**Note: If the asin and amazon_domain parameters are supplied then the url parameter is ignored.**
|
| 1314 |
+
customer_location: Rainforest API supports retrieving data from the following Customer Locations.
|
| 1315 |
+
|
| 1316 |
+
The Customer Locations is specified via the customer_location request parameter.
|
| 1317 |
+
|
| 1318 |
+
The Customer Location determines the location that Rainforest uses when retrieving pages from Amazon. This is useful, for example, for seeing details of how a product appears on amazon.com, to a customer located in a different country. Can be used to identify cross-border shipping data and opportunities.
|
| 1319 |
+
|
| 1320 |
+
If no value for customer_location is supplied then Rainforest defaults to making the request from the country of the Amazon page requested - i.e. `France` for requests for pages from `amazon.fr`
|
| 1321 |
+
|
| 1322 |
+
The table below shows which customer_location values can be used in combination with requests to which amazon_domains. If you require another Amazon domain / customer location combination please contact our support team.
|
| 1323 |
+
|
| 1324 |
+
See the Request Parameters documentation for more information.
|
| 1325 |
+
|
| 1326 |
+
"""
|
| 1327 |
+
url = f"https://rainforest2.p.rapidapi.com/request"
|
| 1328 |
+
querystring = {'type': type, }
|
| 1329 |
+
if url:
|
| 1330 |
+
querystring['url'] = url
|
| 1331 |
+
if amazon_domain:
|
| 1332 |
+
querystring['amazon_domain'] = amazon_domain
|
| 1333 |
+
if gtin:
|
| 1334 |
+
querystring['gtin'] = gtin
|
| 1335 |
+
if asin:
|
| 1336 |
+
querystring['asin'] = asin
|
| 1337 |
+
if customer_location:
|
| 1338 |
+
querystring['customer_location'] = customer_location
|
| 1339 |
+
|
| 1340 |
+
headers = {
|
| 1341 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 1342 |
+
"X-RapidAPI-Host": "rainforest2.p.rapidapi.com"
|
| 1343 |
+
}
|
| 1344 |
+
|
| 1345 |
+
|
| 1346 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 1347 |
+
try:
|
| 1348 |
+
observation = response.json()
|
| 1349 |
+
except:
|
| 1350 |
+
observation = response.text
|
| 1351 |
+
return observation
|
| 1352 |
+
|
toolbench/toolenv/tools/Data/randgenlocality_api.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_00d6e595-cbfa-4d70-8454-9378a1ebbc99",
|
| 3 |
+
"tool_description": "The RandGenLocality API is a specialized service designed to generate random locality-related data. It empowers developers and users with the ability to create synthetic data for locations, addresses, and geographical information. This API serves as a valuable tool for applications requiring random locality data, including testing, geospatial analysis, and location-based services.",
|
| 4 |
+
"home_url": "https://rapidapi.com/ryginrauofi3/api/randgenlocality-api/",
|
| 5 |
+
"name": "RandGenLocality API",
|
| 6 |
+
"title": "RandGenLocality API",
|
| 7 |
+
"pricing": "PAID",
|
| 8 |
+
"tool_name": "RandGenLocality API",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 474,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 9.2,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "randgenlocality-api.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "newRequest",
|
| 20 |
+
"url": "https://randgenlocality-api.p.rapidapi.com/api/locality",
|
| 21 |
+
"description": " ",
|
| 22 |
+
"method": "POST",
|
| 23 |
+
"required_parameters": [],
|
| 24 |
+
"optional_parameters": [],
|
| 25 |
+
"code": "import requests\n\nurl = \"https://randgenlocality-api.p.rapidapi.com/api/locality\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"randgenlocality-api.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 26 |
+
"convert_code": "import requests\n\nurl = \"https://randgenlocality-api.p.rapidapi.com/api/locality\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"randgenlocality-api.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 27 |
+
"test_endpoint": "",
|
| 28 |
+
"statuscode": 200,
|
| 29 |
+
"schema": {
|
| 30 |
+
"type": "object",
|
| 31 |
+
"properties": {
|
| 32 |
+
"get": {
|
| 33 |
+
"type": "string"
|
| 34 |
+
},
|
| 35 |
+
"parameters": {
|
| 36 |
+
"type": "array"
|
| 37 |
+
},
|
| 38 |
+
"errors": {
|
| 39 |
+
"type": "array"
|
| 40 |
+
},
|
| 41 |
+
"results": {
|
| 42 |
+
"type": "integer"
|
| 43 |
+
},
|
| 44 |
+
"response": {
|
| 45 |
+
"type": "array",
|
| 46 |
+
"items": {
|
| 47 |
+
"type": "object"
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
]
|
| 54 |
+
}
|
toolbench/toolenv/tools/Data/random_article_generator.json
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_55f7d1e2-4c98-4d61-bd63-0faf5bc0302b",
|
| 3 |
+
"tool_description": "Generates random article with specific word length, keyword density and multiple other parameters.",
|
| 4 |
+
"home_url": "https://rapidapi.com/bluezero/api/random-article-generator/",
|
| 5 |
+
"name": "Random Article Generator",
|
| 6 |
+
"title": "Random Article Generator",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "Random Article Generator",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 391,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 8.3,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "random-article-generator.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "Get Article",
|
| 20 |
+
"url": "https://random-article-generator.p.rapidapi.com/",
|
| 21 |
+
"description": "Generates random article depending on the settings.",
|
| 22 |
+
"method": "POST",
|
| 23 |
+
"required_parameters": [
|
| 24 |
+
{
|
| 25 |
+
"name": "keyword",
|
| 26 |
+
"type": "STRING",
|
| 27 |
+
"description": "Your keyword around which the article will be written",
|
| 28 |
+
"default": "your keyword"
|
| 29 |
+
}
|
| 30 |
+
],
|
| 31 |
+
"optional_parameters": [
|
| 32 |
+
{
|
| 33 |
+
"name": "wordsMax",
|
| 34 |
+
"type": "NUMBER",
|
| 35 |
+
"description": "Maximum words per article\nLimit is 5000",
|
| 36 |
+
"default": "2000"
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"name": "minSentencesPerP",
|
| 40 |
+
"type": "NUMBER",
|
| 41 |
+
"description": "Minimum sentences per paragraph",
|
| 42 |
+
"default": "4"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"name": "secnondaryKWDensity",
|
| 46 |
+
"type": "NUMBER",
|
| 47 |
+
"description": "Secondary keywords density",
|
| 48 |
+
"default": "5"
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"name": "maxSentencesPerP",
|
| 52 |
+
"type": "NUMBER",
|
| 53 |
+
"description": "Maximum sentences per paragraph",
|
| 54 |
+
"default": "8"
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"name": "supporting",
|
| 58 |
+
"type": "STRING",
|
| 59 |
+
"description": "Supporting keywords separated by new line",
|
| 60 |
+
"default": ""
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"name": "wordsMin",
|
| 64 |
+
"type": "NUMBER",
|
| 65 |
+
"description": "Minimum words per article\nLimit is 5000",
|
| 66 |
+
"default": "2000"
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"name": "kwDensity",
|
| 70 |
+
"type": "NUMBER",
|
| 71 |
+
"description": "Keyword density",
|
| 72 |
+
"default": "5"
|
| 73 |
+
},
|
| 74 |
+
{
|
| 75 |
+
"name": "maxSentence",
|
| 76 |
+
"type": "NUMBER",
|
| 77 |
+
"description": "Maximum words in sentence",
|
| 78 |
+
"default": "12"
|
| 79 |
+
},
|
| 80 |
+
{
|
| 81 |
+
"name": "minSentence",
|
| 82 |
+
"type": "NUMBER",
|
| 83 |
+
"description": "Minimum words in sentence",
|
| 84 |
+
"default": "10"
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"name": "supportingKWDensity",
|
| 88 |
+
"type": "NUMBER",
|
| 89 |
+
"description": "Supporting keywords density",
|
| 90 |
+
"default": "5"
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"name": "secondary",
|
| 94 |
+
"type": "STRING",
|
| 95 |
+
"description": "Secondary keywords separated by new line",
|
| 96 |
+
"default": ""
|
| 97 |
+
},
|
| 98 |
+
{
|
| 99 |
+
"name": "output",
|
| 100 |
+
"type": "STRING",
|
| 101 |
+
"description": "Output Type (plain, html, htmlp, index)",
|
| 102 |
+
"default": "plain"
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"name": "contentWrapType",
|
| 106 |
+
"type": "STRING",
|
| 107 |
+
"description": "Content Wrap Type\n\n- randomalpha - words generated from letters\n- randomalphanum - words generated from letters and numbers\n- lorem - lorem ipsum\n- randomenglish - random english words",
|
| 108 |
+
"default": "randomenglish"
|
| 109 |
+
}
|
| 110 |
+
],
|
| 111 |
+
"code": "import requests\n\nurl = \"https://random-article-generator.p.rapidapi.com/\"\nquerystring = {\"wordsMax\": \"2000\", \"minSentencesPerP\": \"4\", \"keyword\": \"your keyword\", \"secnondaryKWDensity\": \"5\", \"maxSentencesPerP\": \"8\", \"supporting\": \"\", \"wordsMin\": \"2000\", \"kwDensity\": \"5\", \"maxSentence\": \"12\", \"minSentence\": \"10\", \"supportingKWDensity\": \"5\", \"secondary\": \"\", \"output\": \"plain\", \"contentWrapType\": \"randomenglish\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-article-generator.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 112 |
+
"convert_code": "import requests\n\nurl = \"https://random-article-generator.p.rapidapi.com/\"\nquerystring = {\"wordsMax\": \"2000\", \"minSentencesPerP\": \"4\", \"keyword\": \"your keyword\", \"secnondaryKWDensity\": \"5\", \"maxSentencesPerP\": \"8\", \"supporting\": \"\", \"wordsMin\": \"2000\", \"kwDensity\": \"5\", \"maxSentence\": \"12\", \"minSentence\": \"10\", \"supportingKWDensity\": \"5\", \"secondary\": \"\", \"output\": \"plain\", \"contentWrapType\": \"randomenglish\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-article-generator.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 113 |
+
"test_endpoint": ""
|
| 114 |
+
}
|
| 115 |
+
]
|
| 116 |
+
}
|
toolbench/toolenv/tools/Data/random_choise.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_0b28d444-70fa-4c68-9bfe-54f60ed88298",
|
| 3 |
+
"tool_description": "The Random Choice feature is a fun and engaging tool that allows users to make decisions in a spontaneous and exciting way. Whether you're unsure about what to eat for dinner, which movie to watch, or even what activity to do on a weekend, the Random Choice feature has got you covered! With a simple click or tap, the Random Choice feature selects a random option from a given list, making decision-making entertaining and stress-free. It's like flipping a coin or drawing straws, but in a digit...",
|
| 4 |
+
"home_url": "https://rapidapi.com/neybamrcr/api/random-choise/",
|
| 5 |
+
"name": "random choise",
|
| 6 |
+
"title": "random choise",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "random choise",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 430,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 9.6,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "random-choise.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "randomChoise",
|
| 20 |
+
"url": "https://random-choise.p.rapidapi.com/api/random-choice",
|
| 21 |
+
"description": " ",
|
| 22 |
+
"method": "POST",
|
| 23 |
+
"required_parameters": [],
|
| 24 |
+
"optional_parameters": [],
|
| 25 |
+
"code": "import requests\n\nurl = \"https://random-choise.p.rapidapi.com/api/random-choice\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-choise.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 26 |
+
"convert_code": "import requests\n\nurl = \"https://random-choise.p.rapidapi.com/api/random-choice\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-choise.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 27 |
+
"test_endpoint": "",
|
| 28 |
+
"statuscode": 200,
|
| 29 |
+
"schema": {
|
| 30 |
+
"type": "object",
|
| 31 |
+
"properties": {
|
| 32 |
+
"get": {
|
| 33 |
+
"type": "string"
|
| 34 |
+
},
|
| 35 |
+
"parameters": {
|
| 36 |
+
"type": "array"
|
| 37 |
+
},
|
| 38 |
+
"errors": {
|
| 39 |
+
"type": "array"
|
| 40 |
+
},
|
| 41 |
+
"results": {
|
| 42 |
+
"type": "integer"
|
| 43 |
+
},
|
| 44 |
+
"response": {
|
| 45 |
+
"type": "array",
|
| 46 |
+
"items": {
|
| 47 |
+
"type": "object"
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
]
|
| 54 |
+
}
|
toolbench/toolenv/tools/Data/random_choose_champion_legend_of_league.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_0002064d-9187-485c-9b5f-d18a0ff4e120",
|
| 3 |
+
"tool_description": "The League of Legends Random Champion API allows developers and gamers to retrieve information about a randomly chosen League of Legends champion. This API provides an easy way to introduce variety and fun into the gaming experience by randomly selecting a champion for the player to use in their next match.",
|
| 4 |
+
"home_url": "https://rapidapi.com/karimymelvyd/api/random-choose-champion-legend-of-league/",
|
| 5 |
+
"name": "random choose champion legend of league",
|
| 6 |
+
"title": "random choose champion legend of league",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "random choose champion legend of league",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 436,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 9.6,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "random-choose-champion-legend-of-league.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "postChampion",
|
| 20 |
+
"url": "https://random-choose-champion-legend-of-league.p.rapidapi.com/api/champion",
|
| 21 |
+
"description": " ",
|
| 22 |
+
"method": "POST",
|
| 23 |
+
"required_parameters": [],
|
| 24 |
+
"optional_parameters": [],
|
| 25 |
+
"code": "import requests\n\nurl = \"https://random-choose-champion-legend-of-league.p.rapidapi.com/api/champion\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-choose-champion-legend-of-league.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 26 |
+
"convert_code": "import requests\n\nurl = \"https://random-choose-champion-legend-of-league.p.rapidapi.com/api/champion\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-choose-champion-legend-of-league.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 27 |
+
"test_endpoint": "",
|
| 28 |
+
"statuscode": 200,
|
| 29 |
+
"schema": {
|
| 30 |
+
"type": "object",
|
| 31 |
+
"properties": {
|
| 32 |
+
"get": {
|
| 33 |
+
"type": "string"
|
| 34 |
+
},
|
| 35 |
+
"parameters": {
|
| 36 |
+
"type": "array"
|
| 37 |
+
},
|
| 38 |
+
"errors": {
|
| 39 |
+
"type": "array"
|
| 40 |
+
},
|
| 41 |
+
"results": {
|
| 42 |
+
"type": "integer"
|
| 43 |
+
},
|
| 44 |
+
"response": {
|
| 45 |
+
"type": "array",
|
| 46 |
+
"items": {
|
| 47 |
+
"type": "object"
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
]
|
| 54 |
+
}
|
toolbench/toolenv/tools/Data/random_chunk_api.json
ADDED
|
@@ -0,0 +1,529 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name": "Random Chunk API",
|
| 3 |
+
"tool_description": "A simple random picker for names, movies, TV shows, quotes, and numbers. A simple JSON object, user object, and array generator.",
|
| 4 |
+
"title": "Random Chunk API",
|
| 5 |
+
"pricing": "FREEMIUM",
|
| 6 |
+
"score": {
|
| 7 |
+
"avgServiceLevel": 100,
|
| 8 |
+
"avgLatency": 30405,
|
| 9 |
+
"avgSuccessRate": 92,
|
| 10 |
+
"popularityScore": 8.7,
|
| 11 |
+
"__typename": "Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url": "https://rapidapi.com/rur209-fl23Nrvhxii/api/random-chunk-api/",
|
| 14 |
+
"host": "random-chunk-api.p.rapidapi.com",
|
| 15 |
+
"api_list": [
|
| 16 |
+
{
|
| 17 |
+
"name": "getRandomColor",
|
| 18 |
+
"url": "https://random-chunk-api.p.rapidapi.com/api/color",
|
| 19 |
+
"description": "Get a random quote.",
|
| 20 |
+
"method": "GET",
|
| 21 |
+
"required_parameters": [],
|
| 22 |
+
"optional_parameters": [],
|
| 23 |
+
"code": "import requests\n\nurl = \"https://random-chunk-api.p.rapidapi.com/api/color\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-chunk-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 24 |
+
"statuscode": 200,
|
| 25 |
+
"body": {},
|
| 26 |
+
"headers": {},
|
| 27 |
+
"schema": {
|
| 28 |
+
"type": "object",
|
| 29 |
+
"properties": {
|
| 30 |
+
"get": {
|
| 31 |
+
"type": "string"
|
| 32 |
+
},
|
| 33 |
+
"parameters": {
|
| 34 |
+
"type": "array"
|
| 35 |
+
},
|
| 36 |
+
"errors": {
|
| 37 |
+
"type": "array"
|
| 38 |
+
},
|
| 39 |
+
"results": {
|
| 40 |
+
"type": "integer"
|
| 41 |
+
},
|
| 42 |
+
"response": {
|
| 43 |
+
"type": "array",
|
| 44 |
+
"items": {
|
| 45 |
+
"type": "object"
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
"name": "getRandomQuote",
|
| 53 |
+
"url": "https://random-chunk-api.p.rapidapi.com/api/quote",
|
| 54 |
+
"description": "Get a random quote.",
|
| 55 |
+
"method": "GET",
|
| 56 |
+
"required_parameters": [],
|
| 57 |
+
"optional_parameters": [
|
| 58 |
+
{
|
| 59 |
+
"name": "category",
|
| 60 |
+
"type": "STRING",
|
| 61 |
+
"description": "",
|
| 62 |
+
"default": "life"
|
| 63 |
+
},
|
| 64 |
+
{
|
| 65 |
+
"name": "count",
|
| 66 |
+
"type": "NUMBER",
|
| 67 |
+
"description": "",
|
| 68 |
+
"default": "1"
|
| 69 |
+
}
|
| 70 |
+
],
|
| 71 |
+
"code": "import requests\n\nurl = \"https://random-chunk-api.p.rapidapi.com/api/quote\"\nquerystring = {\"category\": category, \"count\": count}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-chunk-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 72 |
+
"statuscode": 200,
|
| 73 |
+
"body": {},
|
| 74 |
+
"headers": {},
|
| 75 |
+
"schema": {
|
| 76 |
+
"type": "object",
|
| 77 |
+
"properties": {
|
| 78 |
+
"get": {
|
| 79 |
+
"type": "string"
|
| 80 |
+
},
|
| 81 |
+
"parameters": {
|
| 82 |
+
"type": "array"
|
| 83 |
+
},
|
| 84 |
+
"errors": {
|
| 85 |
+
"type": "array"
|
| 86 |
+
},
|
| 87 |
+
"results": {
|
| 88 |
+
"type": "integer"
|
| 89 |
+
},
|
| 90 |
+
"response": {
|
| 91 |
+
"type": "array",
|
| 92 |
+
"items": {
|
| 93 |
+
"type": "object"
|
| 94 |
+
}
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
}
|
| 98 |
+
},
|
| 99 |
+
{
|
| 100 |
+
"name": "getRandomArray",
|
| 101 |
+
"url": "https://random-chunk-api.p.rapidapi.com/api/array",
|
| 102 |
+
"description": "Generate a random array with numbers, words or mixed values.",
|
| 103 |
+
"method": "GET",
|
| 104 |
+
"required_parameters": [],
|
| 105 |
+
"optional_parameters": [
|
| 106 |
+
{
|
| 107 |
+
"name": "data_type",
|
| 108 |
+
"type": "STRING",
|
| 109 |
+
"description": "",
|
| 110 |
+
"default": "string"
|
| 111 |
+
},
|
| 112 |
+
{
|
| 113 |
+
"name": "size",
|
| 114 |
+
"type": "NUMBER",
|
| 115 |
+
"description": "",
|
| 116 |
+
"default": "5"
|
| 117 |
+
}
|
| 118 |
+
],
|
| 119 |
+
"code": "import requests\n\nurl = \"https://random-chunk-api.p.rapidapi.com/api/array\"\nquerystring = {\"data_type\": data_type, \"size\": size}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-chunk-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 120 |
+
"statuscode": 200,
|
| 121 |
+
"body": {},
|
| 122 |
+
"headers": {},
|
| 123 |
+
"schema": {
|
| 124 |
+
"type": "object",
|
| 125 |
+
"properties": {
|
| 126 |
+
"get": {
|
| 127 |
+
"type": "string"
|
| 128 |
+
},
|
| 129 |
+
"parameters": {
|
| 130 |
+
"type": "array"
|
| 131 |
+
},
|
| 132 |
+
"errors": {
|
| 133 |
+
"type": "array"
|
| 134 |
+
},
|
| 135 |
+
"results": {
|
| 136 |
+
"type": "integer"
|
| 137 |
+
},
|
| 138 |
+
"response": {
|
| 139 |
+
"type": "array",
|
| 140 |
+
"items": {
|
| 141 |
+
"type": "object"
|
| 142 |
+
}
|
| 143 |
+
}
|
| 144 |
+
}
|
| 145 |
+
}
|
| 146 |
+
},
|
| 147 |
+
{
|
| 148 |
+
"name": "getRandomWord",
|
| 149 |
+
"url": "https://random-chunk-api.p.rapidapi.com/api/word",
|
| 150 |
+
"description": "Get random words.",
|
| 151 |
+
"method": "GET",
|
| 152 |
+
"required_parameters": [],
|
| 153 |
+
"optional_parameters": [
|
| 154 |
+
{
|
| 155 |
+
"name": "type",
|
| 156 |
+
"type": "STRING",
|
| 157 |
+
"description": "",
|
| 158 |
+
"default": "adjective"
|
| 159 |
+
},
|
| 160 |
+
{
|
| 161 |
+
"name": "count",
|
| 162 |
+
"type": "NUMBER",
|
| 163 |
+
"description": "",
|
| 164 |
+
"default": "1"
|
| 165 |
+
}
|
| 166 |
+
],
|
| 167 |
+
"code": "import requests\n\nurl = \"https://random-chunk-api.p.rapidapi.com/api/word\"\nquerystring = {\"type\": type, \"count\": count}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-chunk-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 168 |
+
"statuscode": 200,
|
| 169 |
+
"body": {},
|
| 170 |
+
"headers": {},
|
| 171 |
+
"schema": {
|
| 172 |
+
"type": "object",
|
| 173 |
+
"properties": {
|
| 174 |
+
"get": {
|
| 175 |
+
"type": "string"
|
| 176 |
+
},
|
| 177 |
+
"parameters": {
|
| 178 |
+
"type": "array"
|
| 179 |
+
},
|
| 180 |
+
"errors": {
|
| 181 |
+
"type": "array"
|
| 182 |
+
},
|
| 183 |
+
"results": {
|
| 184 |
+
"type": "integer"
|
| 185 |
+
},
|
| 186 |
+
"response": {
|
| 187 |
+
"type": "array",
|
| 188 |
+
"items": {
|
| 189 |
+
"type": "object"
|
| 190 |
+
}
|
| 191 |
+
}
|
| 192 |
+
}
|
| 193 |
+
}
|
| 194 |
+
},
|
| 195 |
+
{
|
| 196 |
+
"name": "getRandomTvshow",
|
| 197 |
+
"url": "https://random-chunk-api.p.rapidapi.com/api/tvshow",
|
| 198 |
+
"description": "Returns random TVshows.",
|
| 199 |
+
"method": "GET",
|
| 200 |
+
"required_parameters": [],
|
| 201 |
+
"optional_parameters": [],
|
| 202 |
+
"code": "import requests\n\nurl = \"https://random-chunk-api.p.rapidapi.com/api/tvshow\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-chunk-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 203 |
+
"statuscode": 200,
|
| 204 |
+
"body": {},
|
| 205 |
+
"headers": {},
|
| 206 |
+
"schema": {
|
| 207 |
+
"type": "object",
|
| 208 |
+
"properties": {
|
| 209 |
+
"get": {
|
| 210 |
+
"type": "string"
|
| 211 |
+
},
|
| 212 |
+
"parameters": {
|
| 213 |
+
"type": "array"
|
| 214 |
+
},
|
| 215 |
+
"errors": {
|
| 216 |
+
"type": "array"
|
| 217 |
+
},
|
| 218 |
+
"results": {
|
| 219 |
+
"type": "integer"
|
| 220 |
+
},
|
| 221 |
+
"response": {
|
| 222 |
+
"type": "array",
|
| 223 |
+
"items": {
|
| 224 |
+
"type": "object"
|
| 225 |
+
}
|
| 226 |
+
}
|
| 227 |
+
}
|
| 228 |
+
}
|
| 229 |
+
},
|
| 230 |
+
{
|
| 231 |
+
"name": "getRandomMovie",
|
| 232 |
+
"url": "https://random-chunk-api.p.rapidapi.com/api/movie",
|
| 233 |
+
"description": "Returns random movies from over 1000 movie list.",
|
| 234 |
+
"method": "GET",
|
| 235 |
+
"required_parameters": [],
|
| 236 |
+
"optional_parameters": [
|
| 237 |
+
{
|
| 238 |
+
"name": "count",
|
| 239 |
+
"type": "NUMBER",
|
| 240 |
+
"description": "",
|
| 241 |
+
"default": "2"
|
| 242 |
+
}
|
| 243 |
+
],
|
| 244 |
+
"code": "import requests\n\nurl = \"https://random-chunk-api.p.rapidapi.com/api/movie\"\nquerystring = {\"count\": count}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-chunk-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 245 |
+
"statuscode": 200,
|
| 246 |
+
"body": {},
|
| 247 |
+
"headers": {},
|
| 248 |
+
"schema": {
|
| 249 |
+
"type": "object",
|
| 250 |
+
"properties": {
|
| 251 |
+
"get": {
|
| 252 |
+
"type": "string"
|
| 253 |
+
},
|
| 254 |
+
"parameters": {
|
| 255 |
+
"type": "array"
|
| 256 |
+
},
|
| 257 |
+
"errors": {
|
| 258 |
+
"type": "array"
|
| 259 |
+
},
|
| 260 |
+
"results": {
|
| 261 |
+
"type": "integer"
|
| 262 |
+
},
|
| 263 |
+
"response": {
|
| 264 |
+
"type": "array",
|
| 265 |
+
"items": {
|
| 266 |
+
"type": "object"
|
| 267 |
+
}
|
| 268 |
+
}
|
| 269 |
+
}
|
| 270 |
+
}
|
| 271 |
+
},
|
| 272 |
+
{
|
| 273 |
+
"name": "getRandomUser",
|
| 274 |
+
"url": "https://random-chunk-api.p.rapidapi.com/api/user",
|
| 275 |
+
"description": "Returns random user data such as name, e-mail, etc.",
|
| 276 |
+
"method": "GET",
|
| 277 |
+
"required_parameters": [],
|
| 278 |
+
"optional_parameters": [
|
| 279 |
+
{
|
| 280 |
+
"name": "count",
|
| 281 |
+
"type": "NUMBER",
|
| 282 |
+
"description": "",
|
| 283 |
+
"default": "-2"
|
| 284 |
+
}
|
| 285 |
+
],
|
| 286 |
+
"code": "import requests\n\nurl = \"https://random-chunk-api.p.rapidapi.com/api/user\"\nquerystring = {\"count\": count}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-chunk-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 287 |
+
"statuscode": 200,
|
| 288 |
+
"body": {},
|
| 289 |
+
"headers": {},
|
| 290 |
+
"schema": {
|
| 291 |
+
"type": "object",
|
| 292 |
+
"properties": {
|
| 293 |
+
"get": {
|
| 294 |
+
"type": "string"
|
| 295 |
+
},
|
| 296 |
+
"parameters": {
|
| 297 |
+
"type": "array"
|
| 298 |
+
},
|
| 299 |
+
"errors": {
|
| 300 |
+
"type": "array"
|
| 301 |
+
},
|
| 302 |
+
"results": {
|
| 303 |
+
"type": "integer"
|
| 304 |
+
},
|
| 305 |
+
"response": {
|
| 306 |
+
"type": "array",
|
| 307 |
+
"items": {
|
| 308 |
+
"type": "object"
|
| 309 |
+
}
|
| 310 |
+
}
|
| 311 |
+
}
|
| 312 |
+
}
|
| 313 |
+
},
|
| 314 |
+
{
|
| 315 |
+
"name": "getRandomName",
|
| 316 |
+
"url": "https://random-chunk-api.p.rapidapi.com/api/name",
|
| 317 |
+
"description": "Returns random people's names..",
|
| 318 |
+
"method": "GET",
|
| 319 |
+
"required_parameters": [],
|
| 320 |
+
"optional_parameters": [
|
| 321 |
+
{
|
| 322 |
+
"name": "count",
|
| 323 |
+
"type": "NUMBER",
|
| 324 |
+
"description": "",
|
| 325 |
+
"default": "2"
|
| 326 |
+
},
|
| 327 |
+
{
|
| 328 |
+
"name": "startingLetter",
|
| 329 |
+
"type": "STRING",
|
| 330 |
+
"description": "",
|
| 331 |
+
"default": "X"
|
| 332 |
+
},
|
| 333 |
+
{
|
| 334 |
+
"name": "type",
|
| 335 |
+
"type": "STRING",
|
| 336 |
+
"description": "",
|
| 337 |
+
"default": ""
|
| 338 |
+
}
|
| 339 |
+
],
|
| 340 |
+
"code": "import requests\n\nurl = \"https://random-chunk-api.p.rapidapi.com/api/name\"\nquerystring = {\"count\": count, \"startingLetter\": startingletter}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-chunk-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 341 |
+
"statuscode": 200,
|
| 342 |
+
"body": {},
|
| 343 |
+
"headers": {},
|
| 344 |
+
"schema": {
|
| 345 |
+
"type": "object",
|
| 346 |
+
"properties": {
|
| 347 |
+
"get": {
|
| 348 |
+
"type": "string"
|
| 349 |
+
},
|
| 350 |
+
"parameters": {
|
| 351 |
+
"type": "array"
|
| 352 |
+
},
|
| 353 |
+
"errors": {
|
| 354 |
+
"type": "array"
|
| 355 |
+
},
|
| 356 |
+
"results": {
|
| 357 |
+
"type": "integer"
|
| 358 |
+
},
|
| 359 |
+
"response": {
|
| 360 |
+
"type": "array",
|
| 361 |
+
"items": {
|
| 362 |
+
"type": "object"
|
| 363 |
+
}
|
| 364 |
+
}
|
| 365 |
+
}
|
| 366 |
+
}
|
| 367 |
+
},
|
| 368 |
+
{
|
| 369 |
+
"name": "getRandomObject",
|
| 370 |
+
"url": "https://random-chunk-api.p.rapidapi.com/api/object",
|
| 371 |
+
"description": "Generate simple single-level JSON objects by specifying a JSON object schema with the keys name and value type(boolean, array,)",
|
| 372 |
+
"method": "POST",
|
| 373 |
+
"required_parameters": [],
|
| 374 |
+
"optional_parameters": [],
|
| 375 |
+
"code": "import requests\n\nurl = \"https://random-chunk-api.p.rapidapi.com/api/object\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-chunk-api.p.rapidapi.com\"\n}\n\nresponse = requests.post(url, headers=headers)\n\nprint(response.json())\n",
|
| 376 |
+
"statuscode": 200,
|
| 377 |
+
"body": {},
|
| 378 |
+
"headers": {},
|
| 379 |
+
"schema": {
|
| 380 |
+
"type": "object",
|
| 381 |
+
"properties": {
|
| 382 |
+
"get": {
|
| 383 |
+
"type": "string"
|
| 384 |
+
},
|
| 385 |
+
"parameters": {
|
| 386 |
+
"type": "array"
|
| 387 |
+
},
|
| 388 |
+
"errors": {
|
| 389 |
+
"type": "array"
|
| 390 |
+
},
|
| 391 |
+
"results": {
|
| 392 |
+
"type": "integer"
|
| 393 |
+
},
|
| 394 |
+
"response": {
|
| 395 |
+
"type": "array",
|
| 396 |
+
"items": {
|
| 397 |
+
"type": "object"
|
| 398 |
+
}
|
| 399 |
+
}
|
| 400 |
+
}
|
| 401 |
+
}
|
| 402 |
+
},
|
| 403 |
+
{
|
| 404 |
+
"name": "getRandomDate",
|
| 405 |
+
"url": "https://random-chunk-api.p.rapidapi.com/api/date",
|
| 406 |
+
"description": "Get random date.",
|
| 407 |
+
"method": "GET",
|
| 408 |
+
"required_parameters": [],
|
| 409 |
+
"optional_parameters": [
|
| 410 |
+
{
|
| 411 |
+
"name": "start",
|
| 412 |
+
"type": "STRING",
|
| 413 |
+
"description": "",
|
| 414 |
+
"default": "2022-08-21"
|
| 415 |
+
},
|
| 416 |
+
{
|
| 417 |
+
"name": "end",
|
| 418 |
+
"type": "STRING",
|
| 419 |
+
"description": "",
|
| 420 |
+
"default": "2023-12-30"
|
| 421 |
+
}
|
| 422 |
+
],
|
| 423 |
+
"code": "import requests\n\nurl = \"https://random-chunk-api.p.rapidapi.com/api/date\"\nquerystring = {\"start\": start, \"end\": end}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-chunk-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 424 |
+
"statuscode": 200,
|
| 425 |
+
"body": {},
|
| 426 |
+
"headers": {},
|
| 427 |
+
"schema": {
|
| 428 |
+
"type": "object",
|
| 429 |
+
"properties": {
|
| 430 |
+
"get": {
|
| 431 |
+
"type": "string"
|
| 432 |
+
},
|
| 433 |
+
"parameters": {
|
| 434 |
+
"type": "array"
|
| 435 |
+
},
|
| 436 |
+
"errors": {
|
| 437 |
+
"type": "array"
|
| 438 |
+
},
|
| 439 |
+
"results": {
|
| 440 |
+
"type": "integer"
|
| 441 |
+
},
|
| 442 |
+
"response": {
|
| 443 |
+
"type": "array",
|
| 444 |
+
"items": {
|
| 445 |
+
"type": "object"
|
| 446 |
+
}
|
| 447 |
+
}
|
| 448 |
+
}
|
| 449 |
+
}
|
| 450 |
+
},
|
| 451 |
+
{
|
| 452 |
+
"name": "getRandomPassword",
|
| 453 |
+
"url": "https://random-chunk-api.p.rapidapi.com/api/password",
|
| 454 |
+
"description": "Get random password string.",
|
| 455 |
+
"method": "GET",
|
| 456 |
+
"required_parameters": [],
|
| 457 |
+
"optional_parameters": [
|
| 458 |
+
{
|
| 459 |
+
"name": "length",
|
| 460 |
+
"type": "NUMBER",
|
| 461 |
+
"description": "",
|
| 462 |
+
"default": "10"
|
| 463 |
+
}
|
| 464 |
+
],
|
| 465 |
+
"code": "import requests\n\nurl = \"https://random-chunk-api.p.rapidapi.com/api/password\"\nquerystring = {\"length\": length}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-chunk-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 466 |
+
"statuscode": 200,
|
| 467 |
+
"body": {},
|
| 468 |
+
"headers": {},
|
| 469 |
+
"schema": {
|
| 470 |
+
"type": "object",
|
| 471 |
+
"properties": {
|
| 472 |
+
"get": {
|
| 473 |
+
"type": "string"
|
| 474 |
+
},
|
| 475 |
+
"parameters": {
|
| 476 |
+
"type": "array"
|
| 477 |
+
},
|
| 478 |
+
"errors": {
|
| 479 |
+
"type": "array"
|
| 480 |
+
},
|
| 481 |
+
"results": {
|
| 482 |
+
"type": "integer"
|
| 483 |
+
},
|
| 484 |
+
"response": {
|
| 485 |
+
"type": "array",
|
| 486 |
+
"items": {
|
| 487 |
+
"type": "object"
|
| 488 |
+
}
|
| 489 |
+
}
|
| 490 |
+
}
|
| 491 |
+
}
|
| 492 |
+
},
|
| 493 |
+
{
|
| 494 |
+
"name": "getRandomObject",
|
| 495 |
+
"url": "https://random-chunk-api.p.rapidapi.com/api/object",
|
| 496 |
+
"description": "Generate simple single-level JSON objects by specifying a JSON object schema with the keys name and value type(boolean, array,)",
|
| 497 |
+
"method": "POST",
|
| 498 |
+
"required_parameters": [],
|
| 499 |
+
"optional_parameters": [],
|
| 500 |
+
"code": "import requests\n\nurl = \"https://random-chunk-api.p.rapidapi.com/api/object\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-chunk-api.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 501 |
+
"convert_code": "import requests\n\nurl = \"https://random-chunk-api.p.rapidapi.com/api/object\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-chunk-api.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 502 |
+
"test_endpoint": "",
|
| 503 |
+
"statuscode": 200,
|
| 504 |
+
"schema": {
|
| 505 |
+
"type": "object",
|
| 506 |
+
"properties": {
|
| 507 |
+
"get": {
|
| 508 |
+
"type": "string"
|
| 509 |
+
},
|
| 510 |
+
"parameters": {
|
| 511 |
+
"type": "array"
|
| 512 |
+
},
|
| 513 |
+
"errors": {
|
| 514 |
+
"type": "array"
|
| 515 |
+
},
|
| 516 |
+
"results": {
|
| 517 |
+
"type": "integer"
|
| 518 |
+
},
|
| 519 |
+
"response": {
|
| 520 |
+
"type": "array",
|
| 521 |
+
"items": {
|
| 522 |
+
"type": "object"
|
| 523 |
+
}
|
| 524 |
+
}
|
| 525 |
+
}
|
| 526 |
+
}
|
| 527 |
+
}
|
| 528 |
+
]
|
| 529 |
+
}
|
toolbench/toolenv/tools/Data/random_chunk_api/api.py
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def getrandomcolor(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get a random quote."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://random-chunk-api.p.rapidapi.com/api/color"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "random-chunk-api.p.rapidapi.com"
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 24 |
+
try:
|
| 25 |
+
observation = response.json()
|
| 26 |
+
except:
|
| 27 |
+
observation = response.text
|
| 28 |
+
return observation
|
| 29 |
+
|
| 30 |
+
def getrandomquote(category: str='life', count: int=1, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"Get a random quote."
|
| 33 |
+
|
| 34 |
+
"""
|
| 35 |
+
url = f"https://random-chunk-api.p.rapidapi.com/api/quote"
|
| 36 |
+
querystring = {}
|
| 37 |
+
if category:
|
| 38 |
+
querystring['category'] = category
|
| 39 |
+
if count:
|
| 40 |
+
querystring['count'] = count
|
| 41 |
+
|
| 42 |
+
headers = {
|
| 43 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 44 |
+
"X-RapidAPI-Host": "random-chunk-api.p.rapidapi.com"
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 49 |
+
try:
|
| 50 |
+
observation = response.json()
|
| 51 |
+
except:
|
| 52 |
+
observation = response.text
|
| 53 |
+
return observation
|
| 54 |
+
|
| 55 |
+
def getrandomarray(data_type: str='string', size: int=5, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 56 |
+
"""
|
| 57 |
+
"Generate a random array with numbers, words or mixed values."
|
| 58 |
+
|
| 59 |
+
"""
|
| 60 |
+
url = f"https://random-chunk-api.p.rapidapi.com/api/array"
|
| 61 |
+
querystring = {}
|
| 62 |
+
if data_type:
|
| 63 |
+
querystring['data_type'] = data_type
|
| 64 |
+
if size:
|
| 65 |
+
querystring['size'] = size
|
| 66 |
+
|
| 67 |
+
headers = {
|
| 68 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 69 |
+
"X-RapidAPI-Host": "random-chunk-api.p.rapidapi.com"
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 74 |
+
try:
|
| 75 |
+
observation = response.json()
|
| 76 |
+
except:
|
| 77 |
+
observation = response.text
|
| 78 |
+
return observation
|
| 79 |
+
|
| 80 |
+
def getrandomword(type: str='adjective', count: int=1, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 81 |
+
"""
|
| 82 |
+
"Get random words."
|
| 83 |
+
|
| 84 |
+
"""
|
| 85 |
+
url = f"https://random-chunk-api.p.rapidapi.com/api/word"
|
| 86 |
+
querystring = {}
|
| 87 |
+
if type:
|
| 88 |
+
querystring['type'] = type
|
| 89 |
+
if count:
|
| 90 |
+
querystring['count'] = count
|
| 91 |
+
|
| 92 |
+
headers = {
|
| 93 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 94 |
+
"X-RapidAPI-Host": "random-chunk-api.p.rapidapi.com"
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 99 |
+
try:
|
| 100 |
+
observation = response.json()
|
| 101 |
+
except:
|
| 102 |
+
observation = response.text
|
| 103 |
+
return observation
|
| 104 |
+
|
| 105 |
+
def getrandomtvshow(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 106 |
+
"""
|
| 107 |
+
"Returns random TVshows."
|
| 108 |
+
|
| 109 |
+
"""
|
| 110 |
+
url = f"https://random-chunk-api.p.rapidapi.com/api/tvshow"
|
| 111 |
+
querystring = {}
|
| 112 |
+
|
| 113 |
+
headers = {
|
| 114 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 115 |
+
"X-RapidAPI-Host": "random-chunk-api.p.rapidapi.com"
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 120 |
+
try:
|
| 121 |
+
observation = response.json()
|
| 122 |
+
except:
|
| 123 |
+
observation = response.text
|
| 124 |
+
return observation
|
| 125 |
+
|
| 126 |
+
def getrandommovie(count: int=2, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 127 |
+
"""
|
| 128 |
+
"Returns random movies from over 1000 movie list."
|
| 129 |
+
|
| 130 |
+
"""
|
| 131 |
+
url = f"https://random-chunk-api.p.rapidapi.com/api/movie"
|
| 132 |
+
querystring = {}
|
| 133 |
+
if count:
|
| 134 |
+
querystring['count'] = count
|
| 135 |
+
|
| 136 |
+
headers = {
|
| 137 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 138 |
+
"X-RapidAPI-Host": "random-chunk-api.p.rapidapi.com"
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
|
| 142 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 143 |
+
try:
|
| 144 |
+
observation = response.json()
|
| 145 |
+
except:
|
| 146 |
+
observation = response.text
|
| 147 |
+
return observation
|
| 148 |
+
|
| 149 |
+
def getrandomuser(count: int=-2, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 150 |
+
"""
|
| 151 |
+
"Returns random user data such as name, e-mail, etc."
|
| 152 |
+
|
| 153 |
+
"""
|
| 154 |
+
url = f"https://random-chunk-api.p.rapidapi.com/api/user"
|
| 155 |
+
querystring = {}
|
| 156 |
+
if count:
|
| 157 |
+
querystring['count'] = count
|
| 158 |
+
|
| 159 |
+
headers = {
|
| 160 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 161 |
+
"X-RapidAPI-Host": "random-chunk-api.p.rapidapi.com"
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
|
| 165 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 166 |
+
try:
|
| 167 |
+
observation = response.json()
|
| 168 |
+
except:
|
| 169 |
+
observation = response.text
|
| 170 |
+
return observation
|
| 171 |
+
|
| 172 |
+
def getrandomname(count: int=2, startingletter: str='X', type: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 173 |
+
"""
|
| 174 |
+
"Returns random people's names.."
|
| 175 |
+
|
| 176 |
+
"""
|
| 177 |
+
url = f"https://random-chunk-api.p.rapidapi.com/api/name"
|
| 178 |
+
querystring = {}
|
| 179 |
+
if count:
|
| 180 |
+
querystring['count'] = count
|
| 181 |
+
if startingletter:
|
| 182 |
+
querystring['startingLetter'] = startingletter
|
| 183 |
+
if type:
|
| 184 |
+
querystring['type'] = type
|
| 185 |
+
|
| 186 |
+
headers = {
|
| 187 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 188 |
+
"X-RapidAPI-Host": "random-chunk-api.p.rapidapi.com"
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
|
| 192 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 193 |
+
try:
|
| 194 |
+
observation = response.json()
|
| 195 |
+
except:
|
| 196 |
+
observation = response.text
|
| 197 |
+
return observation
|
| 198 |
+
|
| 199 |
+
def getrandomdate(start: str='2022-08-21', end: str='2023-12-30', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 200 |
+
"""
|
| 201 |
+
"Get random date."
|
| 202 |
+
|
| 203 |
+
"""
|
| 204 |
+
url = f"https://random-chunk-api.p.rapidapi.com/api/date"
|
| 205 |
+
querystring = {}
|
| 206 |
+
if start:
|
| 207 |
+
querystring['start'] = start
|
| 208 |
+
if end:
|
| 209 |
+
querystring['end'] = end
|
| 210 |
+
|
| 211 |
+
headers = {
|
| 212 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 213 |
+
"X-RapidAPI-Host": "random-chunk-api.p.rapidapi.com"
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
|
| 217 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 218 |
+
try:
|
| 219 |
+
observation = response.json()
|
| 220 |
+
except:
|
| 221 |
+
observation = response.text
|
| 222 |
+
return observation
|
| 223 |
+
|
| 224 |
+
def getrandompassword(length: int=10, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 225 |
+
"""
|
| 226 |
+
"Get random password string."
|
| 227 |
+
|
| 228 |
+
"""
|
| 229 |
+
url = f"https://random-chunk-api.p.rapidapi.com/api/password"
|
| 230 |
+
querystring = {}
|
| 231 |
+
if length:
|
| 232 |
+
querystring['length'] = length
|
| 233 |
+
|
| 234 |
+
headers = {
|
| 235 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 236 |
+
"X-RapidAPI-Host": "random-chunk-api.p.rapidapi.com"
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
|
| 240 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 241 |
+
try:
|
| 242 |
+
observation = response.json()
|
| 243 |
+
except:
|
| 244 |
+
observation = response.text
|
| 245 |
+
return observation
|
| 246 |
+
|
toolbench/toolenv/tools/Data/random_dog_photos/api.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def dog_photo_getter(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Takes a 'GET' request and returns a random dog photo from the internet"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://random-dog-photos.p.rapidapi.com/dog"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "random-dog-photos.p.rapidapi.com"
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 24 |
+
try:
|
| 25 |
+
observation = response.json()
|
| 26 |
+
except:
|
| 27 |
+
observation = response.text
|
| 28 |
+
return observation
|
| 29 |
+
|
toolbench/toolenv/tools/Data/random_fact.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_529e5c65-29c8-4693-a051-6079f4196224",
|
| 3 |
+
"tool_description": "fact for live random ",
|
| 4 |
+
"home_url": "https://rapidapi.com/ClaudiaEcon/api/random-fact3/",
|
| 5 |
+
"name": "random- fact",
|
| 6 |
+
"title": "random- fact",
|
| 7 |
+
"pricing": "PAID",
|
| 8 |
+
"tool_name": "random- fact",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 433,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 9.5,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "random-fact3.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "postRandomHumman",
|
| 20 |
+
"url": "https://random-fact3.p.rapidapi.com/api/random-fact",
|
| 21 |
+
"description": " ",
|
| 22 |
+
"method": "POST",
|
| 23 |
+
"required_parameters": [],
|
| 24 |
+
"optional_parameters": [],
|
| 25 |
+
"code": "import requests\n\nurl = \"https://random-fact3.p.rapidapi.com/api/random-fact\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-fact3.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 26 |
+
"convert_code": "import requests\n\nurl = \"https://random-fact3.p.rapidapi.com/api/random-fact\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-fact3.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 27 |
+
"test_endpoint": "",
|
| 28 |
+
"statuscode": 200,
|
| 29 |
+
"schema": {
|
| 30 |
+
"type": "object",
|
| 31 |
+
"properties": {
|
| 32 |
+
"get": {
|
| 33 |
+
"type": "string"
|
| 34 |
+
},
|
| 35 |
+
"parameters": {
|
| 36 |
+
"type": "array"
|
| 37 |
+
},
|
| 38 |
+
"errors": {
|
| 39 |
+
"type": "array"
|
| 40 |
+
},
|
| 41 |
+
"results": {
|
| 42 |
+
"type": "integer"
|
| 43 |
+
},
|
| 44 |
+
"response": {
|
| 45 |
+
"type": "array",
|
| 46 |
+
"items": {
|
| 47 |
+
"type": "object"
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
]
|
| 54 |
+
}
|
toolbench/toolenv/tools/Data/random_famous_quotes.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "53aa60e3e4b0a798dbd1bca3",
|
| 3 |
+
"tool_description": "Get a random quote in JSON format. \r\n\r\nCurrent categories are:\r\n- famous\r\n- movies",
|
| 4 |
+
"home_url": "https://rapidapi.com/andruxnet/api/random-famous-quotes/",
|
| 5 |
+
"name": "Random Famous Quotes",
|
| 6 |
+
"title": "Random Famous Quotes",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "Random Famous Quotes",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 448,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 9.7,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "andruxnet-random-famous-quotes.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "POST endpoint",
|
| 20 |
+
"url": "https://andruxnet-random-famous-quotes.p.rapidapi.com/",
|
| 21 |
+
"description": "Post endpoint for quotes by famous people or from popular movies",
|
| 22 |
+
"method": "POST",
|
| 23 |
+
"required_parameters": [
|
| 24 |
+
{
|
| 25 |
+
"name": "cat",
|
| 26 |
+
"type": "STRING",
|
| 27 |
+
"description": "can be either \"movies\" or \"famous\"",
|
| 28 |
+
"default": "movies"
|
| 29 |
+
}
|
| 30 |
+
],
|
| 31 |
+
"optional_parameters": [
|
| 32 |
+
{
|
| 33 |
+
"name": "count",
|
| 34 |
+
"type": "NUMBER",
|
| 35 |
+
"description": "Number of quotes to return. If omitted, a single quote will be returned. Max number of quotes is 10",
|
| 36 |
+
"default": "10"
|
| 37 |
+
}
|
| 38 |
+
],
|
| 39 |
+
"code": "import requests\n\nurl = \"https://andruxnet-random-famous-quotes.p.rapidapi.com/\"\nquerystring = {\"count\": \"10\", \"cat\": \"movies\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"andruxnet-random-famous-quotes.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 40 |
+
"convert_code": "import requests\n\nurl = \"https://andruxnet-random-famous-quotes.p.rapidapi.com/\"\nquerystring = {\"count\": \"10\", \"cat\": \"movies\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"andruxnet-random-famous-quotes.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 41 |
+
"test_endpoint": "",
|
| 42 |
+
"statuscode": 1,
|
| 43 |
+
"schema": ""
|
| 44 |
+
}
|
| 45 |
+
]
|
| 46 |
+
}
|
toolbench/toolenv/tools/Data/random_famous_quotes/api.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def get_endpoint(cat: str='famous', count: int=10, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get endpoint for quotes by famous people or from popular movies"
|
| 12 |
+
cat: Get quotes inside any of these categories: "movies" or "famous". If not present get quotes from any category.
|
| 13 |
+
count: Number of quotes to return. If omitted, a single quote will be returned. Max number of quotes is 10
|
| 14 |
+
|
| 15 |
+
"""
|
| 16 |
+
url = f"https://andruxnet-random-famous-quotes.p.rapidapi.com/"
|
| 17 |
+
querystring = {}
|
| 18 |
+
if cat:
|
| 19 |
+
querystring['cat'] = cat
|
| 20 |
+
if count:
|
| 21 |
+
querystring['count'] = count
|
| 22 |
+
|
| 23 |
+
headers = {
|
| 24 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 25 |
+
"X-RapidAPI-Host": "andruxnet-random-famous-quotes.p.rapidapi.com"
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 30 |
+
try:
|
| 31 |
+
observation = response.json()
|
| 32 |
+
except:
|
| 33 |
+
observation = response.text
|
| 34 |
+
return observation
|
| 35 |
+
|
toolbench/toolenv/tools/Data/random_identity_generator/api.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def get_random_identity_default_format(gender: str='male', minage: str='18', maxage: str='65', country: str='us', nameset: str='american', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get a random identity base on the parametes/query provided."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://random-identity-generator.p.rapidapi.com/identity"
|
| 15 |
+
querystring = {}
|
| 16 |
+
if gender:
|
| 17 |
+
querystring['gender'] = gender
|
| 18 |
+
if minage:
|
| 19 |
+
querystring['minAge'] = minage
|
| 20 |
+
if maxage:
|
| 21 |
+
querystring['maxAge'] = maxage
|
| 22 |
+
if country:
|
| 23 |
+
querystring['country'] = country
|
| 24 |
+
if nameset:
|
| 25 |
+
querystring['nameSet'] = nameset
|
| 26 |
+
|
| 27 |
+
headers = {
|
| 28 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 29 |
+
"X-RapidAPI-Host": "random-identity-generator.p.rapidapi.com"
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 34 |
+
try:
|
| 35 |
+
observation = response.json()
|
| 36 |
+
except:
|
| 37 |
+
observation = response.text
|
| 38 |
+
return observation
|
| 39 |
+
|
toolbench/toolenv/tools/Data/random_indonesian_word.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name":"Random Indonesian Word",
|
| 3 |
+
"tool_description":"An API to get randomize word in Indonesia Language.",
|
| 4 |
+
"title":"Random Indonesian Word",
|
| 5 |
+
"pricing":"PAID",
|
| 6 |
+
"score":{
|
| 7 |
+
"avgServiceLevel":100,
|
| 8 |
+
"avgLatency":686,
|
| 9 |
+
"avgSuccessRate":100,
|
| 10 |
+
"popularityScore":8.8,
|
| 11 |
+
"__typename":"Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url":"https://rapidapi.com/pararang/api/random-indonesian-word/",
|
| 14 |
+
"host":"random-indonesian-word.p.rapidapi.com",
|
| 15 |
+
"api_list":[
|
| 16 |
+
{
|
| 17 |
+
"name":"Get Random Words",
|
| 18 |
+
"url":"https://random-indonesian-word.p.rapidapi.com/words/random",
|
| 19 |
+
"description":"Get random words in Indonesia Language, minimal 1 word, and maximal 32 words. The long will be greater than 2 characters.",
|
| 20 |
+
"method":"GET",
|
| 21 |
+
"required_parameters":[],
|
| 22 |
+
"optional_parameters":[
|
| 23 |
+
{
|
| 24 |
+
"name":"limit",
|
| 25 |
+
"type":"NUMBER",
|
| 26 |
+
"description":"total word, between 1-32",
|
| 27 |
+
"default":"5"
|
| 28 |
+
}
|
| 29 |
+
],
|
| 30 |
+
"code":"import requests\n\nurl = \"https://random-indonesian-word.p.rapidapi.com/words/random\"\nquerystring = {\"limit\": limit}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-indonesian-word.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 31 |
+
"statuscode":111,
|
| 32 |
+
"body":"",
|
| 33 |
+
"headers":"",
|
| 34 |
+
"schema":""
|
| 35 |
+
}
|
| 36 |
+
]
|
| 37 |
+
}
|
toolbench/toolenv/tools/Data/random_indonesian_word/api.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def get_random_words(limit: int=5, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get random words in Indonesia Language, minimal 1 word, and maximal 32 words. The long will be greater than 2 characters."
|
| 12 |
+
limit: total word, between 1-32
|
| 13 |
+
|
| 14 |
+
"""
|
| 15 |
+
url = f"https://random-indonesian-word.p.rapidapi.com/words/random"
|
| 16 |
+
querystring = {}
|
| 17 |
+
if limit:
|
| 18 |
+
querystring['limit'] = limit
|
| 19 |
+
|
| 20 |
+
headers = {
|
| 21 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 22 |
+
"X-RapidAPI-Host": "random-indonesian-word.p.rapidapi.com"
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 27 |
+
try:
|
| 28 |
+
observation = response.json()
|
| 29 |
+
except:
|
| 30 |
+
observation = response.text
|
| 31 |
+
return observation
|
| 32 |
+
|
toolbench/toolenv/tools/Data/random_mockup_person.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_949c4221-b6cd-48be-911c-86c8bdb29d02",
|
| 3 |
+
"tool_description": "random mockup person",
|
| 4 |
+
"home_url": "https://rapidapi.com/jamebornn/api/random-mockup-person/",
|
| 5 |
+
"name": "random mockup person",
|
| 6 |
+
"title": "random mockup person",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "random mockup person",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 436,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 9.7,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "random-mockup-person.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "getListPerson",
|
| 20 |
+
"url": "https://random-mockup-person.p.rapidapi.com/api/v1/get-list",
|
| 21 |
+
"description": " ",
|
| 22 |
+
"method": "POST",
|
| 23 |
+
"required_parameters": [],
|
| 24 |
+
"optional_parameters": [],
|
| 25 |
+
"code": "import requests\n\nurl = \"https://random-mockup-person.p.rapidapi.com/api/v1/get-list\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-mockup-person.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 26 |
+
"convert_code": "import requests\n\nurl = \"https://random-mockup-person.p.rapidapi.com/api/v1/get-list\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-mockup-person.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 27 |
+
"test_endpoint": "",
|
| 28 |
+
"statuscode": 200,
|
| 29 |
+
"schema": {
|
| 30 |
+
"type": "object",
|
| 31 |
+
"properties": {
|
| 32 |
+
"get": {
|
| 33 |
+
"type": "string"
|
| 34 |
+
},
|
| 35 |
+
"parameters": {
|
| 36 |
+
"type": "array"
|
| 37 |
+
},
|
| 38 |
+
"errors": {
|
| 39 |
+
"type": "array"
|
| 40 |
+
},
|
| 41 |
+
"results": {
|
| 42 |
+
"type": "integer"
|
| 43 |
+
},
|
| 44 |
+
"response": {
|
| 45 |
+
"type": "array",
|
| 46 |
+
"items": {
|
| 47 |
+
"type": "object"
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
]
|
| 54 |
+
}
|
toolbench/toolenv/tools/Data/random_name_and_gender_generator.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name":"Random Name and Gender Generator",
|
| 3 |
+
"tool_description":"returning random first name , last name and gender (fake)",
|
| 4 |
+
"title":"Random Name and Gender Generator",
|
| 5 |
+
"pricing":"FREEMIUM",
|
| 6 |
+
"score":{
|
| 7 |
+
"avgServiceLevel":100,
|
| 8 |
+
"avgLatency":666,
|
| 9 |
+
"avgSuccessRate":100,
|
| 10 |
+
"popularityScore":8.3,
|
| 11 |
+
"__typename":"Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url":"https://rapidapi.com/cvexa/api/random-name-and-gender-generator/",
|
| 14 |
+
"host":"random-name-and-gender-generator.p.rapidapi.com",
|
| 15 |
+
"api_list":[
|
| 16 |
+
{
|
| 17 |
+
"name":"get random first name , last name and gender",
|
| 18 |
+
"url":"https://random-name-and-gender-generator.p.rapidapi.com/",
|
| 19 |
+
"description":"get random first name , last name and gender",
|
| 20 |
+
"method":"GET",
|
| 21 |
+
"required_parameters":[],
|
| 22 |
+
"optional_parameters":[],
|
| 23 |
+
"code":"import requests\n\nurl = \"https://random-name-and-gender-generator.p.rapidapi.com/\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-name-and-gender-generator.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 24 |
+
"statuscode":200,
|
| 25 |
+
"body":{
|
| 26 |
+
"firstName":"Stokes",
|
| 27 |
+
"lastName":"Colon",
|
| 28 |
+
"gender":"male"
|
| 29 |
+
},
|
| 30 |
+
"headers":{
|
| 31 |
+
"access-control-allow-credentials":"true",
|
| 32 |
+
"access-control-allow-origin":"*",
|
| 33 |
+
"connection":"keep-alive",
|
| 34 |
+
"content-length":"57",
|
| 35 |
+
"content-type":"application/json",
|
| 36 |
+
"date":"Tue, 09 Nov 2021 15:45:08 GMT",
|
| 37 |
+
"server":"RapidAPI-1.2.8",
|
| 38 |
+
"via":"1.1 vegur",
|
| 39 |
+
"x-rapidapi-region":"AWS - eu-central-1",
|
| 40 |
+
"x-rapidapi-version":"1.2.8"
|
| 41 |
+
},
|
| 42 |
+
"schema":{}
|
| 43 |
+
}
|
| 44 |
+
]
|
| 45 |
+
}
|
toolbench/toolenv/tools/Data/random_name_and_gender_generator/api.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def get_random_first_name_last_name_and_gender(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"get random first name , last name and gender"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://random-name-and-gender-generator.p.rapidapi.com/"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "random-name-and-gender-generator.p.rapidapi.com"
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 24 |
+
try:
|
| 25 |
+
observation = response.json()
|
| 26 |
+
except:
|
| 27 |
+
observation = response.text
|
| 28 |
+
return observation
|
| 29 |
+
|
toolbench/toolenv/tools/Data/random_quote_api/api.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def get_random_quote(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get a random quote with a single HTTP request in a matter of milliseconds."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://random-quote-api3.p.rapidapi.com/"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "random-quote-api3.p.rapidapi.com"
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 24 |
+
try:
|
| 25 |
+
observation = response.json()
|
| 26 |
+
except:
|
| 27 |
+
observation = response.text
|
| 28 |
+
return observation
|
| 29 |
+
|
toolbench/toolenv/tools/Data/random_quotes.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_fb58d39e-ff5c-4c74-baac-f7ea94360a67",
|
| 3 |
+
"tool_description": "random about quotes, get and post quotes from topic",
|
| 4 |
+
"home_url": "https://rapidapi.com/Consufi/api/random-quotes18/",
|
| 5 |
+
"name": "random quotes",
|
| 6 |
+
"title": "random quotes",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "random quotes",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 437,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 9.7,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "random-quotes18.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "postTopic",
|
| 20 |
+
"url": "https://random-quotes18.p.rapidapi.com/api/random-quote-topic",
|
| 21 |
+
"description": " ",
|
| 22 |
+
"method": "POST",
|
| 23 |
+
"required_parameters": [],
|
| 24 |
+
"optional_parameters": [],
|
| 25 |
+
"code": "import requests\n\nurl = \"https://random-quotes18.p.rapidapi.com/api/random-quote-topic\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-quotes18.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 26 |
+
"convert_code": "import requests\n\nurl = \"https://random-quotes18.p.rapidapi.com/api/random-quote-topic\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-quotes18.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 27 |
+
"test_endpoint": ""
|
| 28 |
+
}
|
| 29 |
+
]
|
| 30 |
+
}
|
toolbench/toolenv/tools/Data/random_quotes_v1.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_e4d3b84b-592a-4dff-938f-6aba8f0aedf8",
|
| 3 |
+
"tool_description": "",
|
| 4 |
+
"home_url": "https://rapidapi.com/ziaprog/api/random-quotes-v1/",
|
| 5 |
+
"name": "Random Quotes V1",
|
| 6 |
+
"title": "Random Quotes V1",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "Random Quotes V1",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 2361,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 7.7,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "random-quotes-v1.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "Quotes",
|
| 20 |
+
"url": "https://random-quotes-v1.p.rapidapi.com/quotes",
|
| 21 |
+
"description": "Returns 5 random quotes",
|
| 22 |
+
"method": "GET",
|
| 23 |
+
"required_parameters": [],
|
| 24 |
+
"optional_parameters": [],
|
| 25 |
+
"code": "import requests\n\nurl = \"https://random-quotes-v1.p.rapidapi.com/quotes\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-quotes-v1.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 26 |
+
"convert_code": "import requests\n\nurl = \"https://random-quotes-v1.p.rapidapi.com/quotes\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-quotes-v1.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 27 |
+
"test_endpoint": {
|
| 28 |
+
"quotes": [
|
| 29 |
+
{
|
| 30 |
+
"author": "Stanley Crouch",
|
| 31 |
+
"id": 40576,
|
| 32 |
+
"keywords": "Culture, Obsession, Popular",
|
| 33 |
+
"quote": "Under popular culture's obsession with a naive inclusion, everything is O.K."
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"author": "Stephen Malkmus",
|
| 37 |
+
"id": 105500,
|
| 38 |
+
"keywords": "Sound, Voice",
|
| 39 |
+
"quote": "A good voice isn't so important. It's more important to sound really unique."
|
| 40 |
+
},
|
| 41 |
+
{
|
| 42 |
+
"author": "Christine Lahti",
|
| 43 |
+
"id": 95261,
|
| 44 |
+
"keywords": "NaN",
|
| 45 |
+
"quote": "I like to take up something that is challenging. I like to stretch myself."
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"author": "Marc Wallice",
|
| 49 |
+
"id": 170015,
|
| 50 |
+
"keywords": "Mother, Friend, Nothing, Want",
|
| 51 |
+
"quote": "I got nothing. I got my shoes and my pants. I'm staying with a friend. I stop by my mother's every once in a while to get my calls. I don't want to be anywhere anybody can find me."
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
"author": "Abu Bakr",
|
| 55 |
+
"id": 9863,
|
| 56 |
+
"keywords": "Knowledge, Exploitation, Folly",
|
| 57 |
+
"quote": "When knowledge is limited - it leads to folly... When knowledge exceeds a certain limit, it leads to exploitation."
|
| 58 |
+
}
|
| 59 |
+
]
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
],
|
| 63 |
+
"standardized_name": "random_quotes_v1"
|
| 64 |
+
}
|
toolbench/toolenv/tools/Data/random_quotes_v1/api.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def quotes(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Returns 5 random quotes"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://random-quotes-v1.p.rapidapi.com/quotes"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "random-quotes-v1.p.rapidapi.com"
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 24 |
+
try:
|
| 25 |
+
observation = response.json()
|
| 26 |
+
except:
|
| 27 |
+
observation = response.text
|
| 28 |
+
return observation
|
| 29 |
+
|
toolbench/toolenv/tools/Data/random_user_by_api_ninjas.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name":"Random User by API-Ninjas",
|
| 3 |
+
"tool_description":"Random user data generator for placeholders and testing. See more info at https://api-ninjas.com/api/randomuser",
|
| 4 |
+
"title":"Random User by API-Ninjas",
|
| 5 |
+
"pricing":"FREEMIUM",
|
| 6 |
+
"score":{
|
| 7 |
+
"avgServiceLevel":100,
|
| 8 |
+
"avgLatency":256,
|
| 9 |
+
"avgSuccessRate":100,
|
| 10 |
+
"popularityScore":9.8,
|
| 11 |
+
"__typename":"Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url":"https://rapidapi.com/apininjas/api/random-user-by-api-ninjas/",
|
| 14 |
+
"host":"random-user-by-api-ninjas.p.rapidapi.com",
|
| 15 |
+
"api_list":[
|
| 16 |
+
{
|
| 17 |
+
"name":"/v1/randomuser",
|
| 18 |
+
"url":"https://random-user-by-api-ninjas.p.rapidapi.com/v1/randomuser",
|
| 19 |
+
"description":"API Ninjas Random User API endpoint. Returns a fake random user profile.",
|
| 20 |
+
"method":"GET",
|
| 21 |
+
"required_parameters":[],
|
| 22 |
+
"optional_parameters":[],
|
| 23 |
+
"code":"import requests\n\nurl = \"https://random-user-by-api-ninjas.p.rapidapi.com/v1/randomuser\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-user-by-api-ninjas.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 24 |
+
"statuscode":111,
|
| 25 |
+
"body":"",
|
| 26 |
+
"headers":"",
|
| 27 |
+
"schema":""
|
| 28 |
+
}
|
| 29 |
+
]
|
| 30 |
+
}
|
toolbench/toolenv/tools/Data/random_user_by_api_ninjas/api.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def v1_randomuser(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"API Ninjas Random User API endpoint. Returns a fake random user profile."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://random-user-by-api-ninjas.p.rapidapi.com/v1/randomuser"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "random-user-by-api-ninjas.p.rapidapi.com"
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 24 |
+
try:
|
| 25 |
+
observation = response.json()
|
| 26 |
+
except:
|
| 27 |
+
observation = response.text
|
| 28 |
+
return observation
|
| 29 |
+
|
toolbench/toolenv/tools/Data/random_users_data/api.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def get_data(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"request to get data"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://random-users-data.p.rapidapi.com/users.php"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "random-users-data.p.rapidapi.com"
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 24 |
+
try:
|
| 25 |
+
observation = response.json()
|
| 26 |
+
except:
|
| 27 |
+
observation = response.text
|
| 28 |
+
return observation
|
| 29 |
+
|
toolbench/toolenv/tools/Data/random_word_api.json
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name":"Random Word API",
|
| 3 |
+
"tool_description":"This easy-to-use, 100% free API randomely picks out words from the entire english dictionnary with many parameters. Supports selecting words of a certain length or that start with a certain letter or a certain string of characters, or both, and much more!",
|
| 4 |
+
"title":"Random Word API",
|
| 5 |
+
"pricing":"FREE",
|
| 6 |
+
"score":{
|
| 7 |
+
"avgServiceLevel":100,
|
| 8 |
+
"avgLatency":501,
|
| 9 |
+
"avgSuccessRate":100,
|
| 10 |
+
"popularityScore":9.9,
|
| 11 |
+
"__typename":"Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url":"https://rapidapi.com/uiopuiopuiop3385/api/random-word-api/",
|
| 14 |
+
"host":"random-word-api.p.rapidapi.com",
|
| 15 |
+
"api_list":[
|
| 16 |
+
{
|
| 17 |
+
"name":"Get Word by Length and Start",
|
| 18 |
+
"url":"https://random-word-api.p.rapidapi.com/LS/{length}/{start}",
|
| 19 |
+
"description":"Returns a random word of specified length and that starts with specified string.\nFor example, 7 and \"fru\" will return any word that is 7 letters long and starts with \"fru\", such as \"fruiter\".",
|
| 20 |
+
"method":"GET",
|
| 21 |
+
"required_parameters":[
|
| 22 |
+
{
|
| 23 |
+
"name":"length",
|
| 24 |
+
"type":"NUMBER",
|
| 25 |
+
"description":"",
|
| 26 |
+
"default":"7"
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"name":"start",
|
| 30 |
+
"type":"string",
|
| 31 |
+
"description":"",
|
| 32 |
+
"default":"fru"
|
| 33 |
+
}
|
| 34 |
+
],
|
| 35 |
+
"optional_parameters":[],
|
| 36 |
+
"code":"import requests\n\nurl = \"https://random-word-api.p.rapidapi.com/LS/{length}/{start}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-word-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 37 |
+
"statuscode":111,
|
| 38 |
+
"body":"",
|
| 39 |
+
"headers":"",
|
| 40 |
+
"schema":""
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"name":"Get Word by Contain",
|
| 44 |
+
"url":"https://random-word-api.p.rapidapi.com/C/{substring}",
|
| 45 |
+
"description":"Returns a random word that contains a certain string.\nFor example, if the string is \"le\" then you will get any word that contains the string, whether it's at **the start, the end or the middle**, and you will get for example \"odourless\".",
|
| 46 |
+
"method":"GET",
|
| 47 |
+
"required_parameters":[
|
| 48 |
+
{
|
| 49 |
+
"name":"substring",
|
| 50 |
+
"type":"string",
|
| 51 |
+
"description":"",
|
| 52 |
+
"default":"le"
|
| 53 |
+
}
|
| 54 |
+
],
|
| 55 |
+
"optional_parameters":[],
|
| 56 |
+
"code":"import requests\n\nurl = \"https://random-word-api.p.rapidapi.com/C/{substring}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-word-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 57 |
+
"statuscode":111,
|
| 58 |
+
"body":"",
|
| 59 |
+
"headers":"",
|
| 60 |
+
"schema":""
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"name":"Get Word by Start",
|
| 64 |
+
"url":"https://random-word-api.p.rapidapi.com/S/{start}",
|
| 65 |
+
"description":"Returns a random word that starts with the specified string.\nFor example, \"fru\" will only return words that start with \"fru\", such as \"fruit\"",
|
| 66 |
+
"method":"GET",
|
| 67 |
+
"required_parameters":[
|
| 68 |
+
{
|
| 69 |
+
"name":"start",
|
| 70 |
+
"type":"string",
|
| 71 |
+
"description":"",
|
| 72 |
+
"default":"fru"
|
| 73 |
+
}
|
| 74 |
+
],
|
| 75 |
+
"optional_parameters":[],
|
| 76 |
+
"code":"import requests\n\nurl = \"https://random-word-api.p.rapidapi.com/S/{start}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-word-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 77 |
+
"statuscode":111,
|
| 78 |
+
"body":"",
|
| 79 |
+
"headers":"",
|
| 80 |
+
"schema":""
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"name":"Get Word by Length and Contain",
|
| 84 |
+
"url":"https://random-word-api.p.rapidapi.com/LC/{length}/{substring}",
|
| 85 |
+
"description":"Returns a random word that contains a certain string and contains a certain amount of letters.\nFor example, if the substring is \"le\" and the length \"7\", you will get a word that contains \"le\" and is 7 characters long, such as \"dozzled\".",
|
| 86 |
+
"method":"GET",
|
| 87 |
+
"required_parameters":[
|
| 88 |
+
{
|
| 89 |
+
"name":"substring",
|
| 90 |
+
"type":"string",
|
| 91 |
+
"description":"",
|
| 92 |
+
"default":"le"
|
| 93 |
+
},
|
| 94 |
+
{
|
| 95 |
+
"name":"length",
|
| 96 |
+
"type":"NUMBER",
|
| 97 |
+
"description":"",
|
| 98 |
+
"default":"7"
|
| 99 |
+
}
|
| 100 |
+
],
|
| 101 |
+
"optional_parameters":[],
|
| 102 |
+
"code":"import requests\n\nurl = \"https://random-word-api.p.rapidapi.com/LC/{length}/{substring}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-word-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 103 |
+
"statuscode":111,
|
| 104 |
+
"body":"",
|
| 105 |
+
"headers":"",
|
| 106 |
+
"schema":""
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"name":"Get Word by Start and Contain",
|
| 110 |
+
"url":"https://random-word-api.p.rapidapi.com/SC/{start}/{substring}",
|
| 111 |
+
"description":"Returns a random word that starts with a certain string and contains a certain string.\nFor example, if the start is \"fru\" and the substring is \"le\", you will get a word that starts with \"fru\" and contains \"le\", such as \"frustules\".",
|
| 112 |
+
"method":"GET",
|
| 113 |
+
"required_parameters":[
|
| 114 |
+
{
|
| 115 |
+
"name":"substring",
|
| 116 |
+
"type":"string",
|
| 117 |
+
"description":"",
|
| 118 |
+
"default":"le"
|
| 119 |
+
},
|
| 120 |
+
{
|
| 121 |
+
"name":"start",
|
| 122 |
+
"type":"string",
|
| 123 |
+
"description":"",
|
| 124 |
+
"default":"fru"
|
| 125 |
+
}
|
| 126 |
+
],
|
| 127 |
+
"optional_parameters":[],
|
| 128 |
+
"code":"import requests\n\nurl = \"https://random-word-api.p.rapidapi.com/SC/{start}/{substring}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-word-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 129 |
+
"statuscode":111,
|
| 130 |
+
"body":"",
|
| 131 |
+
"headers":"",
|
| 132 |
+
"schema":""
|
| 133 |
+
},
|
| 134 |
+
{
|
| 135 |
+
"name":"Get Word by Length, Start and Contain",
|
| 136 |
+
"url":"https://random-word-api.p.rapidapi.com/LSC/{length}/{start}/{substring}",
|
| 137 |
+
"description":"Returns a random word that is a certain amount of characters long, starts with a certain string and contains a certain string.\nFor example, if the length is 7, the start \"fru\" and the substring \"le\", you will get a 7 letter long word that begins with fru and contains le, like \"frumple\".",
|
| 138 |
+
"method":"GET",
|
| 139 |
+
"required_parameters":[
|
| 140 |
+
{
|
| 141 |
+
"name":"start",
|
| 142 |
+
"type":"string",
|
| 143 |
+
"description":"",
|
| 144 |
+
"default":"fru"
|
| 145 |
+
},
|
| 146 |
+
{
|
| 147 |
+
"name":"length",
|
| 148 |
+
"type":"NUMBER",
|
| 149 |
+
"description":"",
|
| 150 |
+
"default":"7"
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"name":"substring",
|
| 154 |
+
"type":"string",
|
| 155 |
+
"description":"",
|
| 156 |
+
"default":"le"
|
| 157 |
+
}
|
| 158 |
+
],
|
| 159 |
+
"optional_parameters":[],
|
| 160 |
+
"code":"import requests\n\nurl = \"https://random-word-api.p.rapidapi.com/LSC/{length}/{start}/{substring}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-word-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 161 |
+
"statuscode":111,
|
| 162 |
+
"body":"",
|
| 163 |
+
"headers":"",
|
| 164 |
+
"schema":""
|
| 165 |
+
},
|
| 166 |
+
{
|
| 167 |
+
"name":"Get Word by Length",
|
| 168 |
+
"url":"https://random-word-api.p.rapidapi.com/L/{length}",
|
| 169 |
+
"description":"Returns a random word that has the specified length. For example, 7 will return any word that is 7 letters long, such as \"swallow\".",
|
| 170 |
+
"method":"GET",
|
| 171 |
+
"required_parameters":[
|
| 172 |
+
{
|
| 173 |
+
"name":"length",
|
| 174 |
+
"type":"NUMBER",
|
| 175 |
+
"description":"",
|
| 176 |
+
"default":"7"
|
| 177 |
+
}
|
| 178 |
+
],
|
| 179 |
+
"optional_parameters":[],
|
| 180 |
+
"code":"import requests\n\nurl = \"https://random-word-api.p.rapidapi.com/L/{length}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-word-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 181 |
+
"statuscode":111,
|
| 182 |
+
"body":"",
|
| 183 |
+
"headers":"",
|
| 184 |
+
"schema":""
|
| 185 |
+
},
|
| 186 |
+
{
|
| 187 |
+
"name":"Get Word",
|
| 188 |
+
"url":"https://random-word-api.p.rapidapi.com/get_word",
|
| 189 |
+
"description":"Returns a random word. No parameters. Just randomness.",
|
| 190 |
+
"method":"GET",
|
| 191 |
+
"required_parameters":[],
|
| 192 |
+
"optional_parameters":[],
|
| 193 |
+
"code":"import requests\n\nurl = \"https://random-word-api.p.rapidapi.com/get_word\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-word-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 194 |
+
"statuscode":111,
|
| 195 |
+
"body":"",
|
| 196 |
+
"headers":"",
|
| 197 |
+
"schema":""
|
| 198 |
+
},
|
| 199 |
+
{
|
| 200 |
+
"name":"Get French Word",
|
| 201 |
+
"url":"https://random-word-api.p.rapidapi.com/french_word",
|
| 202 |
+
"description":"Same as random word, but grabs a random french word instead.",
|
| 203 |
+
"method":"GET",
|
| 204 |
+
"required_parameters":[],
|
| 205 |
+
"optional_parameters":[],
|
| 206 |
+
"code":"import requests\n\nurl = \"https://random-word-api.p.rapidapi.com/french_word\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-word-api.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 207 |
+
"statuscode":111,
|
| 208 |
+
"body":"",
|
| 209 |
+
"headers":"",
|
| 210 |
+
"schema":""
|
| 211 |
+
}
|
| 212 |
+
]
|
| 213 |
+
}
|
toolbench/toolenv/tools/Data/random_word_api/api.py
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def get_word_by_length_and_start(length: int, start: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Returns a random word of specified length and that starts with specified string.
|
| 12 |
+
For example, 7 and "fru" will return any word that is 7 letters long and starts with "fru", such as "fruiter"."
|
| 13 |
+
|
| 14 |
+
"""
|
| 15 |
+
url = f"https://random-word-api.p.rapidapi.com/ls/{length}/{start}"
|
| 16 |
+
querystring = {}
|
| 17 |
+
|
| 18 |
+
headers = {
|
| 19 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 20 |
+
"X-RapidAPI-Host": "random-word-api.p.rapidapi.com"
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 25 |
+
try:
|
| 26 |
+
observation = response.json()
|
| 27 |
+
except:
|
| 28 |
+
observation = response.text
|
| 29 |
+
return observation
|
| 30 |
+
|
| 31 |
+
def get_word_by_contain(substring: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 32 |
+
"""
|
| 33 |
+
"Returns a random word that contains a certain string.
|
| 34 |
+
For example, if the string is "le" then you will get any word that contains the string, whether it's at **the start, the end or the middle**, and you will get for example "odourless"."
|
| 35 |
+
|
| 36 |
+
"""
|
| 37 |
+
url = f"https://random-word-api.p.rapidapi.com/c/{substring}"
|
| 38 |
+
querystring = {}
|
| 39 |
+
|
| 40 |
+
headers = {
|
| 41 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 42 |
+
"X-RapidAPI-Host": "random-word-api.p.rapidapi.com"
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 47 |
+
try:
|
| 48 |
+
observation = response.json()
|
| 49 |
+
except:
|
| 50 |
+
observation = response.text
|
| 51 |
+
return observation
|
| 52 |
+
|
| 53 |
+
def get_word_by_start(start: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 54 |
+
"""
|
| 55 |
+
"Returns a random word that starts with the specified string.
|
| 56 |
+
For example, "fru" will only return words that start with "fru", such as "fruit""
|
| 57 |
+
|
| 58 |
+
"""
|
| 59 |
+
url = f"https://random-word-api.p.rapidapi.com/s/{start}"
|
| 60 |
+
querystring = {}
|
| 61 |
+
|
| 62 |
+
headers = {
|
| 63 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 64 |
+
"X-RapidAPI-Host": "random-word-api.p.rapidapi.com"
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 69 |
+
try:
|
| 70 |
+
observation = response.json()
|
| 71 |
+
except:
|
| 72 |
+
observation = response.text
|
| 73 |
+
return observation
|
| 74 |
+
|
| 75 |
+
def get_word_by_length_and_contain(substring: str, length: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 76 |
+
"""
|
| 77 |
+
"Returns a random word that contains a certain string and contains a certain amount of letters.
|
| 78 |
+
For example, if the substring is "le" and the length "7", you will get a word that contains "le" and is 7 characters long, such as "dozzled"."
|
| 79 |
+
|
| 80 |
+
"""
|
| 81 |
+
url = f"https://random-word-api.p.rapidapi.com/lc/{length}/{substring}"
|
| 82 |
+
querystring = {}
|
| 83 |
+
|
| 84 |
+
headers = {
|
| 85 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 86 |
+
"X-RapidAPI-Host": "random-word-api.p.rapidapi.com"
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 91 |
+
try:
|
| 92 |
+
observation = response.json()
|
| 93 |
+
except:
|
| 94 |
+
observation = response.text
|
| 95 |
+
return observation
|
| 96 |
+
|
| 97 |
+
def get_word_by_start_and_contain(substring: str, start: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 98 |
+
"""
|
| 99 |
+
"Returns a random word that starts with a certain string and contains a certain string.
|
| 100 |
+
For example, if the start is "fru" and the substring is "le", you will get a word that starts with "fru" and contains "le", such as "frustules"."
|
| 101 |
+
|
| 102 |
+
"""
|
| 103 |
+
url = f"https://random-word-api.p.rapidapi.com/sc/{start}/{substring}"
|
| 104 |
+
querystring = {}
|
| 105 |
+
|
| 106 |
+
headers = {
|
| 107 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 108 |
+
"X-RapidAPI-Host": "random-word-api.p.rapidapi.com"
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 113 |
+
try:
|
| 114 |
+
observation = response.json()
|
| 115 |
+
except:
|
| 116 |
+
observation = response.text
|
| 117 |
+
return observation
|
| 118 |
+
|
| 119 |
+
def get_word_by_length_start_and_contain(start: str, length: int, substring: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 120 |
+
"""
|
| 121 |
+
"Returns a random word that is a certain amount of characters long, starts with a certain string and contains a certain string.
|
| 122 |
+
For example, if the length is 7, the start "fru" and the substring "le", you will get a 7 letter long word that begins with fru and contains le, like "frumple"."
|
| 123 |
+
|
| 124 |
+
"""
|
| 125 |
+
url = f"https://random-word-api.p.rapidapi.com/lsc/{length}/{start}/{substring}"
|
| 126 |
+
querystring = {}
|
| 127 |
+
|
| 128 |
+
headers = {
|
| 129 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 130 |
+
"X-RapidAPI-Host": "random-word-api.p.rapidapi.com"
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 135 |
+
try:
|
| 136 |
+
observation = response.json()
|
| 137 |
+
except:
|
| 138 |
+
observation = response.text
|
| 139 |
+
return observation
|
| 140 |
+
|
| 141 |
+
def get_word_by_length(length: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 142 |
+
"""
|
| 143 |
+
"Returns a random word that has the specified length. For example, 7 will return any word that is 7 letters long, such as "swallow"."
|
| 144 |
+
|
| 145 |
+
"""
|
| 146 |
+
url = f"https://random-word-api.p.rapidapi.com/l/{length}"
|
| 147 |
+
querystring = {}
|
| 148 |
+
|
| 149 |
+
headers = {
|
| 150 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 151 |
+
"X-RapidAPI-Host": "random-word-api.p.rapidapi.com"
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
|
| 155 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 156 |
+
try:
|
| 157 |
+
observation = response.json()
|
| 158 |
+
except:
|
| 159 |
+
observation = response.text
|
| 160 |
+
return observation
|
| 161 |
+
|
| 162 |
+
def get_word(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 163 |
+
"""
|
| 164 |
+
"Returns a random word. No parameters. Just randomness."
|
| 165 |
+
|
| 166 |
+
"""
|
| 167 |
+
url = f"https://random-word-api.p.rapidapi.com/get_word"
|
| 168 |
+
querystring = {}
|
| 169 |
+
|
| 170 |
+
headers = {
|
| 171 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 172 |
+
"X-RapidAPI-Host": "random-word-api.p.rapidapi.com"
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
|
| 176 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 177 |
+
try:
|
| 178 |
+
observation = response.json()
|
| 179 |
+
except:
|
| 180 |
+
observation = response.text
|
| 181 |
+
return observation
|
| 182 |
+
|
| 183 |
+
def get_french_word(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 184 |
+
"""
|
| 185 |
+
"Same as random word, but grabs a random french word instead."
|
| 186 |
+
|
| 187 |
+
"""
|
| 188 |
+
url = f"https://random-word-api.p.rapidapi.com/french_word"
|
| 189 |
+
querystring = {}
|
| 190 |
+
|
| 191 |
+
headers = {
|
| 192 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 193 |
+
"X-RapidAPI-Host": "random-word-api.p.rapidapi.com"
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
|
| 197 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 198 |
+
try:
|
| 199 |
+
observation = response.json()
|
| 200 |
+
except:
|
| 201 |
+
observation = response.text
|
| 202 |
+
return observation
|
| 203 |
+
|
toolbench/toolenv/tools/Data/random_word_generator.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name":"Random Word Generator",
|
| 3 |
+
"tool_description":"Random words and more provided by RandomWordGenerator.com",
|
| 4 |
+
"title":"Random Word Generator",
|
| 5 |
+
"pricing":"FREEMIUM",
|
| 6 |
+
"score":{
|
| 7 |
+
"avgServiceLevel":100,
|
| 8 |
+
"avgLatency":621,
|
| 9 |
+
"avgSuccessRate":100,
|
| 10 |
+
"popularityScore":9.1,
|
| 11 |
+
"__typename":"Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url":"https://rapidapi.com/nsanden/api/random-word-generator2/",
|
| 14 |
+
"host":"random-word-generator2.p.rapidapi.com",
|
| 15 |
+
"api_list":[
|
| 16 |
+
{
|
| 17 |
+
"name":"Generate a random word",
|
| 18 |
+
"url":"https://random-word-generator2.p.rapidapi.com/word.php",
|
| 19 |
+
"description":"Scour through thousands of words from the RandomWordGenerator.com database",
|
| 20 |
+
"method":"GET",
|
| 21 |
+
"required_parameters":[],
|
| 22 |
+
"optional_parameters":[
|
| 23 |
+
{
|
| 24 |
+
"name":"api_key",
|
| 25 |
+
"type":"STRING",
|
| 26 |
+
"description":"",
|
| 27 |
+
"default":"5w36eV0FZJu9QIPlpR18"
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"name":"generator",
|
| 31 |
+
"type":"STRING",
|
| 32 |
+
"description":"",
|
| 33 |
+
"default":"words"
|
| 34 |
+
}
|
| 35 |
+
],
|
| 36 |
+
"code":"import requests\n\nurl = \"https://random-word-generator2.p.rapidapi.com/word.php\"\nquerystring = {\"api_key\": api_key, \"generator\": generator}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-word-generator2.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 37 |
+
"statuscode":111,
|
| 38 |
+
"body":"",
|
| 39 |
+
"headers":"",
|
| 40 |
+
"schema":""
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"name":"Generate a random sentence",
|
| 44 |
+
"url":"https://random-word-generator2.p.rapidapi.com/sentence.php",
|
| 45 |
+
"description":"Generate a random sentence",
|
| 46 |
+
"method":"GET",
|
| 47 |
+
"required_parameters":[],
|
| 48 |
+
"optional_parameters":[],
|
| 49 |
+
"code":"import requests\n\nurl = \"https://random-word-generator2.p.rapidapi.com/sentence.php\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"random-word-generator2.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 50 |
+
"statuscode":111,
|
| 51 |
+
"body":"",
|
| 52 |
+
"headers":"",
|
| 53 |
+
"schema":""
|
| 54 |
+
}
|
| 55 |
+
]
|
| 56 |
+
}
|
toolbench/toolenv/tools/Data/random_word_generator/api.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def generate_a_random_word(api_key: str='5w36eV0FZJu9QIPlpR18', generator: str='words', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Scour through thousands of words from the RandomWordGenerator.com database"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://random-word-generator2.p.rapidapi.com/word.php"
|
| 15 |
+
querystring = {}
|
| 16 |
+
if api_key:
|
| 17 |
+
querystring['api_key'] = api_key
|
| 18 |
+
if generator:
|
| 19 |
+
querystring['generator'] = generator
|
| 20 |
+
|
| 21 |
+
headers = {
|
| 22 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 23 |
+
"X-RapidAPI-Host": "random-word-generator2.p.rapidapi.com"
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 28 |
+
try:
|
| 29 |
+
observation = response.json()
|
| 30 |
+
except:
|
| 31 |
+
observation = response.text
|
| 32 |
+
return observation
|
| 33 |
+
|
| 34 |
+
def generate_a_random_sentence(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 35 |
+
"""
|
| 36 |
+
"Generate a random sentence"
|
| 37 |
+
|
| 38 |
+
"""
|
| 39 |
+
url = f"https://random-word-generator2.p.rapidapi.com/sentence.php"
|
| 40 |
+
querystring = {}
|
| 41 |
+
|
| 42 |
+
headers = {
|
| 43 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 44 |
+
"X-RapidAPI-Host": "random-word-generator2.p.rapidapi.com"
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 49 |
+
try:
|
| 50 |
+
observation = response.json()
|
| 51 |
+
except:
|
| 52 |
+
observation = response.text
|
| 53 |
+
return observation
|
| 54 |
+
|
toolbench/toolenv/tools/Data/randomcompanyinfoapi.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_c6433b0c-bfa4-4898-8630-f48521bf8519",
|
| 3 |
+
"tool_description": "This API generates random company information including company name, domain name, job industry, country, and job title.",
|
| 4 |
+
"home_url": "https://rapidapi.com/fhamheramav/api/randomcompanyinfoapi/",
|
| 5 |
+
"name": "RandomCompanyInfoAPI",
|
| 6 |
+
"title": "RandomCompanyInfoAPI",
|
| 7 |
+
"pricing": "PAID",
|
| 8 |
+
"tool_name": "RandomCompanyInfoAPI",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 552,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 8.7,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "randomcompanyinfoapi.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "postCompany",
|
| 20 |
+
"url": "https://randomcompanyinfoapi.p.rapidapi.com/api/gen-company",
|
| 21 |
+
"description": " ",
|
| 22 |
+
"method": "POST",
|
| 23 |
+
"required_parameters": [],
|
| 24 |
+
"optional_parameters": [],
|
| 25 |
+
"code": "import requests\n\nurl = \"https://randomcompanyinfoapi.p.rapidapi.com/api/gen-company\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"randomcompanyinfoapi.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 26 |
+
"convert_code": "import requests\n\nurl = \"https://randomcompanyinfoapi.p.rapidapi.com/api/gen-company\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"randomcompanyinfoapi.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 27 |
+
"test_endpoint": "",
|
| 28 |
+
"statuscode": 200,
|
| 29 |
+
"schema": {
|
| 30 |
+
"type": "object",
|
| 31 |
+
"properties": {
|
| 32 |
+
"get": {
|
| 33 |
+
"type": "string"
|
| 34 |
+
},
|
| 35 |
+
"parameters": {
|
| 36 |
+
"type": "array"
|
| 37 |
+
},
|
| 38 |
+
"errors": {
|
| 39 |
+
"type": "array"
|
| 40 |
+
},
|
| 41 |
+
"results": {
|
| 42 |
+
"type": "integer"
|
| 43 |
+
},
|
| 44 |
+
"response": {
|
| 45 |
+
"type": "array",
|
| 46 |
+
"items": {
|
| 47 |
+
"type": "object"
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
]
|
| 54 |
+
}
|
toolbench/toolenv/tools/Data/randomizer.json
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_d6943583-dd23-4e0b-8653-5e04c8d24665",
|
| 3 |
+
"tool_description": "Fast and straightforward API to retrieve a random sequence of characters!",
|
| 4 |
+
"home_url": "https://rapidapi.com/tcheetox/api/randomizer/",
|
| 5 |
+
"name": "Randomizer",
|
| 6 |
+
"title": "Randomizer",
|
| 7 |
+
"pricing": "FREE",
|
| 8 |
+
"tool_name": "Randomizer",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 92,
|
| 12 |
+
"avgSuccessRate": 99,
|
| 13 |
+
"popularityScore": 8.4,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "randomizer.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "getRandom",
|
| 20 |
+
"url": "https://randomizer.p.rapidapi.com/randomizer/{length}",
|
| 21 |
+
"description": "Retrieve a random sequence of characters matching the provided query attributes",
|
| 22 |
+
"method": "GET",
|
| 23 |
+
"required_parameters": [
|
| 24 |
+
{
|
| 25 |
+
"name": "length",
|
| 26 |
+
"type": "NUMBER",
|
| 27 |
+
"description": "Sequence length",
|
| 28 |
+
"default": ""
|
| 29 |
+
}
|
| 30 |
+
],
|
| 31 |
+
"optional_parameters": [
|
| 32 |
+
{
|
| 33 |
+
"name": "case",
|
| 34 |
+
"type": "STRING",
|
| 35 |
+
"description": "Force sequence to match case argument",
|
| 36 |
+
"default": "all"
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"name": "extra",
|
| 40 |
+
"type": "STRING",
|
| 41 |
+
"description": "Allow the use of special characters \n\n **true** @#\u00e9$%&\u00f9\u00b5\u00a3-_!\u00e8\u00e7\u00e0\u00f9?^) \n\n **extended** |\"(\u00a7{})\u00b0\u00a8[*]\u00b4`,;./:+=~",
|
| 42 |
+
"default": "true"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"name": "type",
|
| 46 |
+
"type": "STRING",
|
| 47 |
+
"description": "Sequence type \n\n **all** string + number + special",
|
| 48 |
+
"default": "all"
|
| 49 |
+
}
|
| 50 |
+
],
|
| 51 |
+
"code": "import requests\n\nurl = \"https://randomizer.p.rapidapi.com/randomizer/{length}\"\nquerystring = {\"case\": \"all\", \"extra\": \"true\", \"length\": \"\", \"type\": \"all\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"randomizer.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 52 |
+
"convert_code": "import requests\n\nurl = \"https://randomizer.p.rapidapi.com/randomizer/{length}\"\nquerystring = {\"case\": \"all\", \"extra\": \"true\", \"length\": \"\", \"type\": \"all\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"randomizer.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 53 |
+
"test_endpoint": {
|
| 54 |
+
"message": "Unknown query parameter 'length'",
|
| 55 |
+
"errors": [
|
| 56 |
+
{
|
| 57 |
+
"path": ".query.length",
|
| 58 |
+
"message": "Unknown query parameter 'length'"
|
| 59 |
+
}
|
| 60 |
+
]
|
| 61 |
+
},
|
| 62 |
+
"statuscode": 200,
|
| 63 |
+
"schema": {
|
| 64 |
+
"type": "object",
|
| 65 |
+
"required": [
|
| 66 |
+
"data"
|
| 67 |
+
],
|
| 68 |
+
"properties": {
|
| 69 |
+
"data": {
|
| 70 |
+
"type": "string"
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"name": "postRandom",
|
| 77 |
+
"url": "https://randomizer.p.rapidapi.com/randomizer/{length}",
|
| 78 |
+
"description": "Retrieve a random sequence of characters matching the provided query attributes",
|
| 79 |
+
"method": "POST",
|
| 80 |
+
"required_parameters": [
|
| 81 |
+
{
|
| 82 |
+
"name": "length",
|
| 83 |
+
"type": "NUMBER",
|
| 84 |
+
"description": "Sequence length",
|
| 85 |
+
"default": ""
|
| 86 |
+
}
|
| 87 |
+
],
|
| 88 |
+
"optional_parameters": [],
|
| 89 |
+
"code": "import requests\n\nurl = \"https://randomizer.p.rapidapi.com/randomizer/{length}\"\nquerystring = {\"length\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"randomizer.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 90 |
+
"convert_code": "import requests\n\nurl = \"https://randomizer.p.rapidapi.com/randomizer/{length}\"\nquerystring = {\"length\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"randomizer.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 91 |
+
"test_endpoint": "",
|
| 92 |
+
"statuscode": 200,
|
| 93 |
+
"schema": {
|
| 94 |
+
"type": "object",
|
| 95 |
+
"required": [
|
| 96 |
+
"data"
|
| 97 |
+
],
|
| 98 |
+
"properties": {
|
| 99 |
+
"data": {
|
| 100 |
+
"type": "string"
|
| 101 |
+
}
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
],
|
| 106 |
+
"standardized_name": "randomizer"
|
| 107 |
+
}
|
toolbench/toolenv/tools/Data/randomizer/api.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def getrandom(length: int, case: str='all', extra: str='true', type: str='all', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Retrieve a random sequence of characters matching the provided query attributes"
|
| 12 |
+
length: Sequence length
|
| 13 |
+
case: Force sequence to match case argument
|
| 14 |
+
extra: Allow the use of special characters
|
| 15 |
+
|
| 16 |
+
**true** @#é$%&ùµ£-_!èçàù?^)
|
| 17 |
+
|
| 18 |
+
**extended** |"(§{})°¨[*]´`,;./:+=~
|
| 19 |
+
type: Sequence type
|
| 20 |
+
|
| 21 |
+
**all** string + number + special
|
| 22 |
+
|
| 23 |
+
"""
|
| 24 |
+
url = f"https://randomizer.p.rapidapi.com/randomizer/{length}"
|
| 25 |
+
querystring = {}
|
| 26 |
+
if case:
|
| 27 |
+
querystring['case'] = case
|
| 28 |
+
if extra:
|
| 29 |
+
querystring['extra'] = extra
|
| 30 |
+
if type:
|
| 31 |
+
querystring['type'] = type
|
| 32 |
+
|
| 33 |
+
headers = {
|
| 34 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 35 |
+
"X-RapidAPI-Host": "randomizer.p.rapidapi.com"
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 40 |
+
try:
|
| 41 |
+
observation = response.json()
|
| 42 |
+
except:
|
| 43 |
+
observation = response.text
|
| 44 |
+
return observation
|
| 45 |
+
|
toolbench/toolenv/tools/Data/randompointsgenerator_api.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_a737715d-11bd-40e6-9a49-25c278db2f37",
|
| 3 |
+
"tool_description": "The RandomPointsGenerator API is a versatile tool for generating random sets of data points. Whether you're a developer, data scientist, or researcher, this API allows you to easily create random data points for various purposes, from testing and experimentation to statistical analysis.",
|
| 4 |
+
"home_url": "https://rapidapi.com/ozgeyasrag/api/randompointsgenerator-api/",
|
| 5 |
+
"name": " RandomPointsGenerator API",
|
| 6 |
+
"title": " RandomPointsGenerator API",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": " RandomPointsGenerator API",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 487,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 9.3,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "randompointsgenerator-api.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "postPoints",
|
| 20 |
+
"url": "https://randompointsgenerator-api.p.rapidapi.com/api/generate-points",
|
| 21 |
+
"description": " ",
|
| 22 |
+
"method": "POST",
|
| 23 |
+
"required_parameters": [],
|
| 24 |
+
"optional_parameters": [],
|
| 25 |
+
"code": "import requests\n\nurl = \"https://randompointsgenerator-api.p.rapidapi.com/api/generate-points\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"randompointsgenerator-api.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 26 |
+
"convert_code": "import requests\n\nurl = \"https://randompointsgenerator-api.p.rapidapi.com/api/generate-points\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"randompointsgenerator-api.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 27 |
+
"test_endpoint": "",
|
| 28 |
+
"statuscode": 200,
|
| 29 |
+
"schema": {
|
| 30 |
+
"type": "object",
|
| 31 |
+
"properties": {
|
| 32 |
+
"get": {
|
| 33 |
+
"type": "string"
|
| 34 |
+
},
|
| 35 |
+
"parameters": {
|
| 36 |
+
"type": "array"
|
| 37 |
+
},
|
| 38 |
+
"errors": {
|
| 39 |
+
"type": "array"
|
| 40 |
+
},
|
| 41 |
+
"results": {
|
| 42 |
+
"type": "integer"
|
| 43 |
+
},
|
| 44 |
+
"response": {
|
| 45 |
+
"type": "array",
|
| 46 |
+
"items": {
|
| 47 |
+
"type": "object"
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
]
|
| 54 |
+
}
|
toolbench/toolenv/tools/Data/randomprofile.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "53aa5b32e4b07e1f4ebec293",
|
| 3 |
+
"tool_description": "Randomly generated profiles of users for quick and efficient database testing. Ideal for social networks, dating websites, online forums and other people-oriented projects.\r\nIncludes random address, name, date of birth, bank info, credit card number, weight, height, occupation etc.",
|
| 4 |
+
"home_url": "https://rapidapi.com/randomprofile/api/randomprofile/",
|
| 5 |
+
"name": "RandomProfile",
|
| 6 |
+
"title": "RandomProfile",
|
| 7 |
+
"pricing": "FREE",
|
| 8 |
+
"tool_name": "RandomProfile",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 55,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 9.1,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "randomprofile.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "getProfile",
|
| 20 |
+
"url": "https://randomprofile.p.rapidapi.com/api.php",
|
| 21 |
+
"description": "Get two randomly generated user profiles",
|
| 22 |
+
"method": "POST",
|
| 23 |
+
"required_parameters": [
|
| 24 |
+
{
|
| 25 |
+
"name": "countries",
|
| 26 |
+
"type": "STRING",
|
| 27 |
+
"description": "Three letter ISO code of the country of residence for the generated profiles. Can be CHN for China, KOR for South Korea, JPN for Japan, GBR for the United Kingdom and USA for United States",
|
| 28 |
+
"default": "USA"
|
| 29 |
+
}
|
| 30 |
+
],
|
| 31 |
+
"optional_parameters": [
|
| 32 |
+
{
|
| 33 |
+
"name": "format",
|
| 34 |
+
"type": "STRING",
|
| 35 |
+
"description": "The format of the returned result. Can be one of the following: csv, json, xml. By default xml is chosen.",
|
| 36 |
+
"default": "csv"
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"name": "fromAge",
|
| 40 |
+
"type": "STRING",
|
| 41 |
+
"description": "The minimum age of the generated user, in years old. By default 0 (for babies) is chosen.",
|
| 42 |
+
"default": "0"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"name": "toAge",
|
| 46 |
+
"type": "STRING",
|
| 47 |
+
"description": "The maximum age of the generated user, in years old. By default 100 is chosen (which is also the maximum possible value).",
|
| 48 |
+
"default": "100"
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"name": "fullChildren",
|
| 52 |
+
"type": "STRING",
|
| 53 |
+
"description": "A flag which determines whether profiles under 18 years old should be assigned occupation other than \"child\", and bank info, including credit card number. Can be either 0 or 1, default is 0.",
|
| 54 |
+
"default": "1"
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"name": "packages",
|
| 58 |
+
"type": "STRING",
|
| 59 |
+
"description": "Comma-separated IDs of the required data packages. Can be 1 for General data (such as name, address, date of birth etc. - see more details on the web site), 2 for Financial (credit card details, bank name, account number), 3 for Physical (height, weight, clothes size, hair and eyes colour). If none specified,1 is chosen by default.",
|
| 60 |
+
"default": "1,2,3"
|
| 61 |
+
}
|
| 62 |
+
],
|
| 63 |
+
"code": "import requests\n\nurl = \"https://randomprofile.p.rapidapi.com/api.php\"\nquerystring = {\"countries\": \"USA\", \"format\": \"csv\", \"fromAge\": \"0\", \"toAge\": \"100\", \"fullChildren\": \"1\", \"packages\": \"1,2,3\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"randomprofile.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 64 |
+
"convert_code": "import requests\n\nurl = \"https://randomprofile.p.rapidapi.com/api.php\"\nquerystring = {\"countries\": \"USA\", \"format\": \"csv\", \"fromAge\": \"0\", \"toAge\": \"100\", \"fullChildren\": \"1\", \"packages\": \"1,2,3\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"randomprofile.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 65 |
+
"test_endpoint": "",
|
| 66 |
+
"statuscode": 1,
|
| 67 |
+
"schema": ""
|
| 68 |
+
}
|
| 69 |
+
]
|
| 70 |
+
}
|
toolbench/toolenv/tools/Data/ranking_page/api.py
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def ranking_csgo(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Static ranking API"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://ranking-page.p.rapidapi.com/rankings/csgo"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "ranking-page.p.rapidapi.com"
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 24 |
+
try:
|
| 25 |
+
observation = response.json()
|
| 26 |
+
except:
|
| 27 |
+
observation = response.text
|
| 28 |
+
return observation
|
| 29 |
+
|
| 30 |
+
def basketball(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"Test enpoint to get some data"
|
| 33 |
+
|
| 34 |
+
"""
|
| 35 |
+
url = f"https://ranking-page.p.rapidapi.com/rankings/basketball"
|
| 36 |
+
querystring = {}
|
| 37 |
+
|
| 38 |
+
headers = {
|
| 39 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 40 |
+
"X-RapidAPI-Host": "ranking-page.p.rapidapi.com"
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 45 |
+
try:
|
| 46 |
+
observation = response.json()
|
| 47 |
+
except:
|
| 48 |
+
observation = response.text
|
| 49 |
+
return observation
|
| 50 |
+
|
| 51 |
+
def basketball(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 52 |
+
"""
|
| 53 |
+
"Basketball ranking page"
|
| 54 |
+
|
| 55 |
+
"""
|
| 56 |
+
url = f"https://ranking-page.p.rapidapi.com/rankings/basketball"
|
| 57 |
+
querystring = {}
|
| 58 |
+
|
| 59 |
+
headers = {
|
| 60 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 61 |
+
"X-RapidAPI-Host": "ranking-page.p.rapidapi.com"
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 66 |
+
try:
|
| 67 |
+
observation = response.json()
|
| 68 |
+
except:
|
| 69 |
+
observation = response.text
|
| 70 |
+
return observation
|
| 71 |
+
|
| 72 |
+
def ranking_page(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 73 |
+
"""
|
| 74 |
+
"Static ranking API"
|
| 75 |
+
|
| 76 |
+
"""
|
| 77 |
+
url = f"https://ranking-page.p.rapidapi.com/rankings"
|
| 78 |
+
querystring = {}
|
| 79 |
+
|
| 80 |
+
headers = {
|
| 81 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 82 |
+
"X-RapidAPI-Host": "ranking-page.p.rapidapi.com"
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 87 |
+
try:
|
| 88 |
+
observation = response.json()
|
| 89 |
+
except:
|
| 90 |
+
observation = response.text
|
| 91 |
+
return observation
|
| 92 |
+
|
toolbench/toolenv/tools/Data/rapidapi_example/api.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def users(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Provides an array of dummy user data."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://rapidapi-example.p.rapidapi.com/users"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "rapidapi-example.p.rapidapi.com"
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 24 |
+
try:
|
| 25 |
+
observation = response.json()
|
| 26 |
+
except:
|
| 27 |
+
observation = response.text
|
| 28 |
+
return observation
|
| 29 |
+
|
toolbench/toolenv/tools/Data/rata_incidenta_romania/api.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def incidenta_pe_zi(data: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Incidenta in anumita zi (Data in format ZZ.MM.YYYY)"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://rata-incidenta-romania.p.rapidapi.com/incidenta/{data}"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "rata-incidenta-romania.p.rapidapi.com"
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 24 |
+
try:
|
| 25 |
+
observation = response.json()
|
| 26 |
+
except:
|
| 27 |
+
observation = response.text
|
| 28 |
+
return observation
|
| 29 |
+
|
| 30 |
+
def incidenta_lista_generala(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"Lista cu incidenta si data respectiva de cand se masoara"
|
| 33 |
+
|
| 34 |
+
"""
|
| 35 |
+
url = f"https://rata-incidenta-romania.p.rapidapi.com/incidenta"
|
| 36 |
+
querystring = {}
|
| 37 |
+
|
| 38 |
+
headers = {
|
| 39 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 40 |
+
"X-RapidAPI-Host": "rata-incidenta-romania.p.rapidapi.com"
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 45 |
+
try:
|
| 46 |
+
observation = response.json()
|
| 47 |
+
except:
|
| 48 |
+
observation = response.text
|
| 49 |
+
return observation
|
| 50 |
+
|
toolbench/toolenv/tools/Data/rate_checker_by_wubook/api.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def monitored_competitors_from_a_given_user(user_id: str='auto', format: str='json', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
""
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://community-rate-checker-by-wubook.p.rapidapi.com/user"
|
| 15 |
+
querystring = {}
|
| 16 |
+
if user_id:
|
| 17 |
+
querystring['user_id'] = user_id
|
| 18 |
+
if format:
|
| 19 |
+
querystring['format'] = format
|
| 20 |
+
|
| 21 |
+
headers = {
|
| 22 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 23 |
+
"X-RapidAPI-Host": "community-rate-checker-by-wubook.p.rapidapi.com"
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 28 |
+
try:
|
| 29 |
+
observation = response.json()
|
| 30 |
+
except:
|
| 31 |
+
observation = response.text
|
| 32 |
+
return observation
|
| 33 |
+
|
| 34 |
+
def snapshots_available_from_a_given_stay(stay_id: str='539dba784e56e1686bbb0f41', format: str='json', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 35 |
+
"""
|
| 36 |
+
""
|
| 37 |
+
|
| 38 |
+
"""
|
| 39 |
+
url = f"https://community-rate-checker-by-wubook.p.rapidapi.com/stay"
|
| 40 |
+
querystring = {}
|
| 41 |
+
if stay_id:
|
| 42 |
+
querystring['stay_id'] = stay_id
|
| 43 |
+
if format:
|
| 44 |
+
querystring['format'] = format
|
| 45 |
+
|
| 46 |
+
headers = {
|
| 47 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 48 |
+
"X-RapidAPI-Host": "community-rate-checker-by-wubook.p.rapidapi.com"
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 53 |
+
try:
|
| 54 |
+
observation = response.json()
|
| 55 |
+
except:
|
| 56 |
+
observation = response.text
|
| 57 |
+
return observation
|
| 58 |
+
|
| 59 |
+
def stays_from_a_given_competitor(competitor_id: str='539dba784e56e1686bbb0f40', format: str='json', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 60 |
+
"""
|
| 61 |
+
""
|
| 62 |
+
|
| 63 |
+
"""
|
| 64 |
+
url = f"https://community-rate-checker-by-wubook.p.rapidapi.com/competitor"
|
| 65 |
+
querystring = {}
|
| 66 |
+
if competitor_id:
|
| 67 |
+
querystring['competitor_id'] = competitor_id
|
| 68 |
+
if format:
|
| 69 |
+
querystring['format'] = format
|
| 70 |
+
|
| 71 |
+
headers = {
|
| 72 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 73 |
+
"X-RapidAPI-Host": "community-rate-checker-by-wubook.p.rapidapi.com"
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 78 |
+
try:
|
| 79 |
+
observation = response.json()
|
| 80 |
+
except:
|
| 81 |
+
observation = response.text
|
| 82 |
+
return observation
|
| 83 |
+
|
toolbench/toolenv/tools/Data/rchilli_taxonomy.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_731c1acb-22f1-4f16-a713-10b348720f56",
|
| 3 |
+
"tool_description": "RChilli Taxonomy offers a comprehensive collection of skills and job profiles, along with their related information. This latest version brings a remarkable change in the resume/job searching capability of the users. At present, it offers 41,000+ Skills and 27,000+ Job Profiles. Get the recommended skills and job titles through Skills/Jobs Alias. Create extra tags in search engines through similar skills/jobs. The unique ontology will set a benchmark for storing resumes/jobs with its step-by-...",
|
| 4 |
+
"home_url": "https://rapidapi.com/rchilli-inc-rchilli-inc-default/api/rchilli-taxonomy1/",
|
| 5 |
+
"name": "RChilli Taxonomy",
|
| 6 |
+
"title": "RChilli Taxonomy",
|
| 7 |
+
"pricing": "PAID",
|
| 8 |
+
"tool_name": "RChilli Taxonomy",
|
| 9 |
+
"score": null,
|
| 10 |
+
"host": "rchilli-taxonomy1.p.rapidapi.com",
|
| 11 |
+
"api_list": [
|
| 12 |
+
{
|
| 13 |
+
"name": "Skill Taxonomy",
|
| 14 |
+
"url": "https://rchilli-taxonomy1.p.rapidapi.com/taxonomy/skillsearch",
|
| 15 |
+
"description": "Skill Taxonomy API offers you a detailed information of skill based on search keyword.",
|
| 16 |
+
"method": "POST",
|
| 17 |
+
"required_parameters": [],
|
| 18 |
+
"optional_parameters": [],
|
| 19 |
+
"code": "import requests\n\nurl = \"https://rchilli-taxonomy1.p.rapidapi.com/taxonomy/skillsearch\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"rchilli-taxonomy1.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 20 |
+
"convert_code": "import requests\n\nurl = \"https://rchilli-taxonomy1.p.rapidapi.com/taxonomy/skillsearch\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"rchilli-taxonomy1.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 21 |
+
"test_endpoint": "",
|
| 22 |
+
"statuscode": 200,
|
| 23 |
+
"schema": {}
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"name": "Job Profile Taxonomy",
|
| 27 |
+
"url": "https://rchilli-taxonomy1.p.rapidapi.com/taxonomy/jobprofilesearch",
|
| 28 |
+
"description": "Job Profile Taxonomy API offers you a detailed information of Job Profile based on search keyword.",
|
| 29 |
+
"method": "POST",
|
| 30 |
+
"required_parameters": [],
|
| 31 |
+
"optional_parameters": [],
|
| 32 |
+
"code": "import requests\n\nurl = \"https://rchilli-taxonomy1.p.rapidapi.com/taxonomy/jobprofilesearch\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"rchilli-taxonomy1.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 33 |
+
"convert_code": "import requests\n\nurl = \"https://rchilli-taxonomy1.p.rapidapi.com/taxonomy/jobprofilesearch\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"rchilli-taxonomy1.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 34 |
+
"test_endpoint": "",
|
| 35 |
+
"statuscode": 200,
|
| 36 |
+
"schema": {}
|
| 37 |
+
}
|
| 38 |
+
]
|
| 39 |
+
}
|
toolbench/toolenv/tools/Data/react_weather/api.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def hola(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"salir"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://react-weather3.p.rapidapi.com/"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "react-weather3.p.rapidapi.com"
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 24 |
+
try:
|
| 25 |
+
observation = response.json()
|
| 26 |
+
except:
|
| 27 |
+
observation = response.text
|
| 28 |
+
return observation
|
| 29 |
+
|
toolbench/toolenv/tools/Data/real_estate_records.json
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name":"Real Estate Records",
|
| 3 |
+
"tool_description":"Real estate transaction records for New York City and whole New Jersey. Public records have been collected from various sites, standardized using Here.com API, with geolocation information for your consumption. ",
|
| 4 |
+
"title":"Real Estate Records",
|
| 5 |
+
"pricing":"FREEMIUM",
|
| 6 |
+
"score":{
|
| 7 |
+
"avgServiceLevel":100,
|
| 8 |
+
"avgLatency":1163,
|
| 9 |
+
"avgSuccessRate":100,
|
| 10 |
+
"popularityScore":9.2,
|
| 11 |
+
"__typename":"Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url":"https://rapidapi.com/richliao/api/real-estate-records/",
|
| 14 |
+
"host":"real-estate-records.p.rapidapi.com",
|
| 15 |
+
"api_list":[
|
| 16 |
+
{
|
| 17 |
+
"name":"transactions",
|
| 18 |
+
"url":"https://real-estate-records.p.rapidapi.com/search/zipcode",
|
| 19 |
+
"description":"Show transactions given a zipcode. The API returns 50 records each time in descending order by date and supports pagination. This API requires a subscription cost.\n\nThe returned data shows the summary of information. To get further detail (such as the unit of a building that posts the most recent transaction, use summary API.\n\nSample data of the API when query zipcode 10019 is:\n \"data\": [\n {\n \"_id\": {\n \"STREET_NUMBER\": \"310\",\n \"STREET\": \"W 56th St\",\n \"PROPERTY_TYPE\": \"SINGLE RESIDENTIAL COOP UNIT\",\n \"ZIPCODE\": \"10019\",\n \"STATE\": \"NY\"\n },\n \"lastSalesDate\": \"2021-07-21T00:00:00.000Z\",\n \"lastSalesAmount\": 514000,\n \"maxSalesAmount\": 1359000,\n \"TotalRecords\": 74\n },",
|
| 20 |
+
"method":"GET",
|
| 21 |
+
"required_parameters":[
|
| 22 |
+
{
|
| 23 |
+
"name":"zipcode",
|
| 24 |
+
"type":"STRING",
|
| 25 |
+
"description":"",
|
| 26 |
+
"default":"10019"
|
| 27 |
+
}
|
| 28 |
+
],
|
| 29 |
+
"optional_parameters":[
|
| 30 |
+
{
|
| 31 |
+
"name":"page",
|
| 32 |
+
"type":"STRING",
|
| 33 |
+
"description":"",
|
| 34 |
+
"default":"1"
|
| 35 |
+
}
|
| 36 |
+
],
|
| 37 |
+
"code":"import requests\n\nurl = \"https://real-estate-records.p.rapidapi.com/search/zipcode\"\nquerystring = {\"page\": page, \"zipcode\": zipcode}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"real-estate-records.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 38 |
+
"statuscode":111,
|
| 39 |
+
"body":"",
|
| 40 |
+
"headers":"",
|
| 41 |
+
"schema":""
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"name":"detail",
|
| 45 |
+
"url":"https://real-estate-records.p.rapidapi.com/search/detail",
|
| 46 |
+
"description":"Return all detailed historical transactions of a given address. To call this API, it requires to call summary API first using address information. Then use the Id value returned from the summary API and call this API with the same Id. This API requires a subscription cost.",
|
| 47 |
+
"method":"GET",
|
| 48 |
+
"required_parameters":[
|
| 49 |
+
{
|
| 50 |
+
"name":"id",
|
| 51 |
+
"type":"STRING",
|
| 52 |
+
"description":"",
|
| 53 |
+
"default":"6144a05f3afc5ca06e88a2ab"
|
| 54 |
+
}
|
| 55 |
+
],
|
| 56 |
+
"optional_parameters":[],
|
| 57 |
+
"code":"import requests\n\nurl = \"https://real-estate-records.p.rapidapi.com/search/detail\"\nquerystring = {\"id\": id}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"real-estate-records.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 58 |
+
"statuscode":111,
|
| 59 |
+
"body":"",
|
| 60 |
+
"headers":"",
|
| 61 |
+
"schema":""
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"name":"summary",
|
| 65 |
+
"url":"https://real-estate-records.p.rapidapi.com/search/summary",
|
| 66 |
+
"description":"Get a summary of property records by units given an address (if it's a multi-unit building). Street number, name and zipcode are needed to match records. The street names are normalized using Here.com conventions. This API requires a subscription cost. \n\nThis API provides details a level further than the \"address\" endpoint. For instance, for 220 Central Park S, New York, NY 10019 it returns\n \"data\": [\n {\n \"_id\": {\n \"id\": \"6144a17b3afc5ca06ea0dd95\",\n \"Loc\": {\n \"coordinates\": [\n -73.9802,\n 40.76719\n ],\n \"type\": \"Point\"\n },\n \"STREET_NUMBER\": \"220\",\n \"STREET\": \"Central Park S\",\n \"UNIT\": \"67\",\n \"PROPERTY_TYPE\": \"SINGLE RESIDENTIAL CONDO UNIT\",\n \"ZIPCODE\": \"10019\",\n \"STATE\": \"NY\"\n },\n \"lastSalesDate\": \"2021-05-24T00:00:00.000Z\",\n \"lastSalesAmount\": 59500000,\n \"maxSalesAmount\": 59500000,\n \"SQFT\": 0,\n \"TotalRecords\": 1\n },\n\nThe API is available for public records for New York City 5 boroughs, all New Jersey Counties and DC. \nSources of information are:\nNJ: http://tax1.co.monmouth.nj.us/cgi-bin/prc6.cgi?&ms_user=monm&passwd=&srch_type=0&adv=0&out_type=0&district=0200\nNYC Acris: https://a836-acris.nyc.gov/DS/DocumentSearch/Index",
|
| 67 |
+
"method":"GET",
|
| 68 |
+
"required_parameters":[
|
| 69 |
+
{
|
| 70 |
+
"name":"number",
|
| 71 |
+
"type":"STRING",
|
| 72 |
+
"description":"",
|
| 73 |
+
"default":"220"
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"name":"street",
|
| 77 |
+
"type":"STRING",
|
| 78 |
+
"description":"",
|
| 79 |
+
"default":"Central Park S"
|
| 80 |
+
}
|
| 81 |
+
],
|
| 82 |
+
"optional_parameters":[
|
| 83 |
+
{
|
| 84 |
+
"name":"zipcode",
|
| 85 |
+
"type":"STRING",
|
| 86 |
+
"description":"",
|
| 87 |
+
"default":"10019"
|
| 88 |
+
}
|
| 89 |
+
],
|
| 90 |
+
"code":"import requests\n\nurl = \"https://real-estate-records.p.rapidapi.com/search/summary\"\nquerystring = {\"number\": number, \"street\": street, \"zipcode\": zipcode}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"real-estate-records.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 91 |
+
"statuscode":111,
|
| 92 |
+
"body":"",
|
| 93 |
+
"headers":"",
|
| 94 |
+
"schema":""
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"name":"address",
|
| 98 |
+
"url":"https://real-estate-records.p.rapidapi.com/search/address",
|
| 99 |
+
"description":"Get a high level of summary of property records given an address. Street number, name and zipcode are needed to match records. The street names are normalized using Here.com conventions. **This API is free to use.**\n\nIf it's an apartment building, it will return total records available for every property type. For instance, for 220 Central Park S, New York, NY 10019, it returns:\n \"data\": [\n {\n \"_id\": {\n \"STREET_NUMBER\": \"220\",\n \"STREET\": \"Central Park S\",\n \"PROPERTY_TYPE\": \"SINGLE RESIDENTIAL CONDO UNIT\",\n \"ZIPCODE\": \"10019\",\n \"STATE\": \"NY\"\n },\n \"Location\": {\n \"coordinates\": [\n -73.9802,\n 40.76719\n ],\n \"type\": \"Point\"\n },\n \"lastSalesDate\": \"2021-05-24T00:00:00.000Z\",\n \"lastSalesAmount\": 59500000,\n \"maxSalesAmount\": 239958219.15,\n \"TotalRecords\": 100\n },\n\nThe API is available for public records for New York City 5 boroughs, all New Jersey Counties and DC. \nSources of information are:\nNJ: http://tax1.co.monmouth.nj.us/cgi-bin/prc6.cgi?&ms_user=monm&passwd=&srch_type=0&adv=0&out_type=0&district=0200\nNYC Acris: https://a836-acris.nyc.gov/DS/DocumentSearch/Index",
|
| 100 |
+
"method":"GET",
|
| 101 |
+
"required_parameters":[
|
| 102 |
+
{
|
| 103 |
+
"name":"street",
|
| 104 |
+
"type":"STRING",
|
| 105 |
+
"description":"",
|
| 106 |
+
"default":"Central Park S"
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"name":"number",
|
| 110 |
+
"type":"STRING",
|
| 111 |
+
"description":"",
|
| 112 |
+
"default":"220"
|
| 113 |
+
}
|
| 114 |
+
],
|
| 115 |
+
"optional_parameters":[
|
| 116 |
+
{
|
| 117 |
+
"name":"zipcode",
|
| 118 |
+
"type":"STRING",
|
| 119 |
+
"description":"",
|
| 120 |
+
"default":"10019"
|
| 121 |
+
}
|
| 122 |
+
],
|
| 123 |
+
"code":"import requests\n\nurl = \"https://real-estate-records.p.rapidapi.com/search/address\"\nquerystring = {\"street\": street, \"number\": number, \"zipcode\": zipcode}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"real-estate-records.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 124 |
+
"statuscode":111,
|
| 125 |
+
"body":"",
|
| 126 |
+
"headers":"",
|
| 127 |
+
"schema":""
|
| 128 |
+
}
|
| 129 |
+
]
|
| 130 |
+
}
|
toolbench/toolenv/tools/Data/real_estate_records/api.py
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def transactions(zipcode: str, page: str='1', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Show transactions given a zipcode. The API returns 50 records each time in descending order by date and supports pagination. This API requires a subscription cost.
|
| 12 |
+
|
| 13 |
+
The returned data shows the summary of information. To get further detail (such as the unit of a building that posts the most recent transaction, use summary API.
|
| 14 |
+
|
| 15 |
+
Sample data of the API when query zipcode 10019 is:
|
| 16 |
+
"data": [
|
| 17 |
+
{
|
| 18 |
+
"_id": {
|
| 19 |
+
"STREET_NUMBER": "310",
|
| 20 |
+
"STREET": "W 56th St",
|
| 21 |
+
"PROPERTY_TYPE": "SINGLE RESIDENTIAL COOP UNIT",
|
| 22 |
+
"ZIPCODE": "10019",
|
| 23 |
+
"STATE": "NY"
|
| 24 |
+
},
|
| 25 |
+
"lastSalesDate": "2021-07-21T00:00:00.000Z",
|
| 26 |
+
"lastSalesAmount": 514000,
|
| 27 |
+
"maxSalesAmount": 1359000,
|
| 28 |
+
"TotalRecords": 74
|
| 29 |
+
},"
|
| 30 |
+
|
| 31 |
+
"""
|
| 32 |
+
url = f"https://real-estate-records.p.rapidapi.com/search/zipcode"
|
| 33 |
+
querystring = {'zipcode': zipcode, }
|
| 34 |
+
if page:
|
| 35 |
+
querystring['page'] = page
|
| 36 |
+
|
| 37 |
+
headers = {
|
| 38 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 39 |
+
"X-RapidAPI-Host": "real-estate-records.p.rapidapi.com"
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 44 |
+
try:
|
| 45 |
+
observation = response.json()
|
| 46 |
+
except:
|
| 47 |
+
observation = response.text
|
| 48 |
+
return observation
|
| 49 |
+
|
| 50 |
+
def detail(is_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 51 |
+
"""
|
| 52 |
+
"Return all detailed historical transactions of a given address. To call this API, it requires to call summary API first using address information. Then use the Id value returned from the summary API and call this API with the same Id. This API requires a subscription cost."
|
| 53 |
+
|
| 54 |
+
"""
|
| 55 |
+
url = f"https://real-estate-records.p.rapidapi.com/search/detail"
|
| 56 |
+
querystring = {'id': is_id, }
|
| 57 |
+
|
| 58 |
+
headers = {
|
| 59 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 60 |
+
"X-RapidAPI-Host": "real-estate-records.p.rapidapi.com"
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 65 |
+
try:
|
| 66 |
+
observation = response.json()
|
| 67 |
+
except:
|
| 68 |
+
observation = response.text
|
| 69 |
+
return observation
|
| 70 |
+
|
| 71 |
+
def summary(number: str, street: str, zipcode: str='10019', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 72 |
+
"""
|
| 73 |
+
"Get a summary of property records by units given an address (if it's a multi-unit building). Street number, name and zipcode are needed to match records. The street names are normalized using Here.com conventions. This API requires a subscription cost.
|
| 74 |
+
|
| 75 |
+
This API provides details a level further than the "address" endpoint. For instance, for 220 Central Park S, New York, NY 10019 it returns
|
| 76 |
+
"data": [
|
| 77 |
+
{
|
| 78 |
+
"_id": {
|
| 79 |
+
"id": "6144a17b3afc5ca06ea0dd95",
|
| 80 |
+
"Loc": {
|
| 81 |
+
"coordinates": [
|
| 82 |
+
-73.9802,
|
| 83 |
+
40.76719
|
| 84 |
+
],
|
| 85 |
+
"type": "Point"
|
| 86 |
+
},
|
| 87 |
+
"STREET_NUMBER": "220",
|
| 88 |
+
"STREET": "Central Park S",
|
| 89 |
+
"UNIT": "67",
|
| 90 |
+
"PROPERTY_TYPE": "SINGLE RESIDENTIAL CONDO UNIT",
|
| 91 |
+
"ZIPCODE": "10019",
|
| 92 |
+
"STATE": "NY"
|
| 93 |
+
},
|
| 94 |
+
"lastSalesDate": "2021-05-24T00:00:00.000Z",
|
| 95 |
+
"lastSalesAmount": 59500000,
|
| 96 |
+
"maxSalesAmount": 59500000,
|
| 97 |
+
"SQFT": 0,
|
| 98 |
+
"TotalRecords": 1
|
| 99 |
+
},
|
| 100 |
+
|
| 101 |
+
The API is available for public records for New York City 5 boroughs, all New Jersey Counties and DC.
|
| 102 |
+
Sources of information are:
|
| 103 |
+
NJ: http://tax1.co.monmouth.nj.us/cgi-bin/prc6.cgi?&ms_user=monm&passwd=&srch_type=0&adv=0&out_type=0&district=0200
|
| 104 |
+
NYC Acris: https://a836-acris.nyc.gov/DS/DocumentSearch/Index"
|
| 105 |
+
|
| 106 |
+
"""
|
| 107 |
+
url = f"https://real-estate-records.p.rapidapi.com/search/summary"
|
| 108 |
+
querystring = {'number': number, 'street': street, }
|
| 109 |
+
if zipcode:
|
| 110 |
+
querystring['zipcode'] = zipcode
|
| 111 |
+
|
| 112 |
+
headers = {
|
| 113 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 114 |
+
"X-RapidAPI-Host": "real-estate-records.p.rapidapi.com"
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 119 |
+
try:
|
| 120 |
+
observation = response.json()
|
| 121 |
+
except:
|
| 122 |
+
observation = response.text
|
| 123 |
+
return observation
|
| 124 |
+
|
| 125 |
+
def address(street: str, number: str, zipcode: str='10019', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 126 |
+
"""
|
| 127 |
+
"Get a high level of summary of property records given an address. Street number, name and zipcode are needed to match records. The street names are normalized using Here.com conventions. **This API is free to use.**
|
| 128 |
+
|
| 129 |
+
If it's an apartment building, it will return total records available for every property type. For instance, for 220 Central Park S, New York, NY 10019, it returns:
|
| 130 |
+
"data": [
|
| 131 |
+
{
|
| 132 |
+
"_id": {
|
| 133 |
+
"STREET_NUMBER": "220",
|
| 134 |
+
"STREET": "Central Park S",
|
| 135 |
+
"PROPERTY_TYPE": "SINGLE RESIDENTIAL CONDO UNIT",
|
| 136 |
+
"ZIPCODE": "10019",
|
| 137 |
+
"STATE": "NY"
|
| 138 |
+
},
|
| 139 |
+
"Location": {
|
| 140 |
+
"coordinates": [
|
| 141 |
+
-73.9802,
|
| 142 |
+
40.76719
|
| 143 |
+
],
|
| 144 |
+
"type": "Point"
|
| 145 |
+
},
|
| 146 |
+
"lastSalesDate": "2021-05-24T00:00:00.000Z",
|
| 147 |
+
"lastSalesAmount": 59500000,
|
| 148 |
+
"maxSalesAmount": 239958219.15,
|
| 149 |
+
"TotalRecords": 100
|
| 150 |
+
},
|
| 151 |
+
|
| 152 |
+
The API is available for public records for New York City 5 boroughs, all New Jersey Counties and DC.
|
| 153 |
+
Sources of information are:
|
| 154 |
+
NJ: http://tax1.co.monmouth.nj.us/cgi-bin/prc6.cgi?&ms_user=monm&passwd=&srch_type=0&adv=0&out_type=0&district=0200
|
| 155 |
+
NYC Acris: https://a836-acris.nyc.gov/DS/DocumentSearch/Index"
|
| 156 |
+
|
| 157 |
+
"""
|
| 158 |
+
url = f"https://real-estate-records.p.rapidapi.com/search/address"
|
| 159 |
+
querystring = {'street': street, 'number': number, }
|
| 160 |
+
if zipcode:
|
| 161 |
+
querystring['zipcode'] = zipcode
|
| 162 |
+
|
| 163 |
+
headers = {
|
| 164 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 165 |
+
"X-RapidAPI-Host": "real-estate-records.p.rapidapi.com"
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
|
| 169 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 170 |
+
try:
|
| 171 |
+
observation = response.json()
|
| 172 |
+
except:
|
| 173 |
+
observation = response.text
|
| 174 |
+
return observation
|
| 175 |
+
|
toolbench/toolenv/tools/Data/real_time_climate_index.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name":"Real-time climate index",
|
| 3 |
+
"tool_description":"A standard index scaled 1-100 that compiles the most significant factors underlying climate change. R-TCI will make it easier to conceptualize and understand the nature and urgency of the current climate crises.",
|
| 4 |
+
"title":"Real-time climate index",
|
| 5 |
+
"pricing":"FREE",
|
| 6 |
+
"score":{
|
| 7 |
+
"avgServiceLevel":100,
|
| 8 |
+
"avgLatency":1003,
|
| 9 |
+
"avgSuccessRate":100,
|
| 10 |
+
"popularityScore":9,
|
| 11 |
+
"__typename":"Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url":"https://rapidapi.com/ezimmerman/api/real-time-climate-index/",
|
| 14 |
+
"host":"real-time-climate-index.p.rapidapi.com",
|
| 15 |
+
"api_list":[
|
| 16 |
+
{
|
| 17 |
+
"name":"all-data",
|
| 18 |
+
"url":"https://real-time-climate-index.p.rapidapi.com/api/climate-data",
|
| 19 |
+
"description":"Gather all data related to R-TCI",
|
| 20 |
+
"method":"GET",
|
| 21 |
+
"required_parameters":[],
|
| 22 |
+
"optional_parameters":[],
|
| 23 |
+
"code":"import requests\n\nurl = \"https://real-time-climate-index.p.rapidapi.com/api/climate-data\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"real-time-climate-index.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 24 |
+
"statuscode":111,
|
| 25 |
+
"body":"",
|
| 26 |
+
"headers":"",
|
| 27 |
+
"schema":""
|
| 28 |
+
}
|
| 29 |
+
]
|
| 30 |
+
}
|
toolbench/toolenv/tools/Data/real_time_climate_index/api.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def all_data(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Gather all data related to R-TCI"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://real-time-climate-index.p.rapidapi.com/api/climate-data"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "real-time-climate-index.p.rapidapi.com"
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 24 |
+
try:
|
| 25 |
+
observation = response.json()
|
| 26 |
+
except:
|
| 27 |
+
observation = response.text
|
| 28 |
+
return observation
|
| 29 |
+
|
toolbench/toolenv/tools/Data/real_time_image_search.json
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name":"Real-Time Image Search",
|
| 3 |
+
"tool_description":"Fast and Simple image web searches in real-time, with support for all filters available on Google Advanced Image Search.",
|
| 4 |
+
"title":"Real-Time Image Search",
|
| 5 |
+
"pricing":"FREEMIUM",
|
| 6 |
+
"score":{
|
| 7 |
+
"avgServiceLevel":100,
|
| 8 |
+
"avgLatency":1593,
|
| 9 |
+
"avgSuccessRate":100,
|
| 10 |
+
"popularityScore":9.7,
|
| 11 |
+
"__typename":"Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url":"https://rapidapi.com/letscrape-6bRBa3QguO5/api/real-time-image-search/",
|
| 14 |
+
"host":"real-time-image-search.p.rapidapi.com",
|
| 15 |
+
"api_list":[
|
| 16 |
+
{
|
| 17 |
+
"name":"Search Images",
|
| 18 |
+
"url":"https://real-time-image-search.p.rapidapi.com/search",
|
| 19 |
+
"description":"Get real-time image search results from across the web. Supports all Google Images search filters.",
|
| 20 |
+
"method":"GET",
|
| 21 |
+
"required_parameters":[
|
| 22 |
+
{
|
| 23 |
+
"name":"query",
|
| 24 |
+
"type":"STRING",
|
| 25 |
+
"description":"Search query / keyword.",
|
| 26 |
+
"default":"beach"
|
| 27 |
+
}
|
| 28 |
+
],
|
| 29 |
+
"optional_parameters":[
|
| 30 |
+
{
|
| 31 |
+
"name":"region",
|
| 32 |
+
"type":"STRING",
|
| 33 |
+
"description":"The country / region from which to make the query.\n\n**Allowed values:** 2-letter country code, see [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)\n**Default:** us.",
|
| 34 |
+
"default":"us"
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"name":"aspect_ratio",
|
| 38 |
+
"type":"STRING",
|
| 39 |
+
"description":"Find images with a specific aspect ratio.\n\n**Allowed values:** *tall, square, wide, panoramic*",
|
| 40 |
+
"default":""
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"name":"country",
|
| 44 |
+
"type":"STRING",
|
| 45 |
+
"description":"Find images published in a specific country / region.\n\n**Allowed values:** 2-letter country code, see [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)",
|
| 46 |
+
"default":""
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"name":"file_type",
|
| 50 |
+
"type":"STRING",
|
| 51 |
+
"description":"Find images of a specific format / file type.\n\n**Allowed values:** *jpg, jpeg, png, gif, svg, webp, ico, raw*",
|
| 52 |
+
"default":""
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
"name":"safe_search",
|
| 56 |
+
"type":"BOOLEAN",
|
| 57 |
+
"description":"",
|
| 58 |
+
"default":""
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"name":"usage_rights",
|
| 62 |
+
"type":"STRING",
|
| 63 |
+
"description":"Find images with specific usage rights / license / copyright.\n\n**Allowed values:** *creative_commons, commercial*",
|
| 64 |
+
"default":""
|
| 65 |
+
},
|
| 66 |
+
{
|
| 67 |
+
"name":"color",
|
| 68 |
+
"type":"STRING",
|
| 69 |
+
"description":"Find images with a specific dominant color.\n\n**Allowed values:** *red, orange, yellow, green, teal, blue, purple, pink, white, gray, black, brown, full, transparent, grayscale*",
|
| 70 |
+
"default":""
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"name":"size",
|
| 74 |
+
"type":"STRING",
|
| 75 |
+
"description":"Find images of a specific size.\n\n**Allowed values:** *large, medium, icon, 400x300+, 640x480+, 800x600+, 1024x768+, 2mp+, 4mp+, 6mp+, 8mp+, 10mp+, 12mp+, 15mp+, 20mp+, 40mp+, 70mp+*",
|
| 76 |
+
"default":""
|
| 77 |
+
},
|
| 78 |
+
{
|
| 79 |
+
"name":"time",
|
| 80 |
+
"type":"STRING",
|
| 81 |
+
"description":"Find images last updated in a specific time range.\n\n**Allowed values:** *day, week, month, year*",
|
| 82 |
+
"default":""
|
| 83 |
+
},
|
| 84 |
+
{
|
| 85 |
+
"name":"type",
|
| 86 |
+
"type":"STRING",
|
| 87 |
+
"description":"Find images of a specific type.\n\n**Allowed values:** *face, photo, clipart, lineart, animated*",
|
| 88 |
+
"default":""
|
| 89 |
+
}
|
| 90 |
+
],
|
| 91 |
+
"code":"import requests\n\nurl = \"https://real-time-image-search.p.rapidapi.com/search\"\nquerystring = {\"region\": region, \"query\": query}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"real-time-image-search.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 92 |
+
"statuscode":200,
|
| 93 |
+
"body":{
|
| 94 |
+
"key1":"value",
|
| 95 |
+
"key2":"value"
|
| 96 |
+
},
|
| 97 |
+
"headers":{},
|
| 98 |
+
"schema":{
|
| 99 |
+
"type":"object",
|
| 100 |
+
"properties":{
|
| 101 |
+
"status":{
|
| 102 |
+
"type":"string"
|
| 103 |
+
},
|
| 104 |
+
"request_id":{
|
| 105 |
+
"type":"string"
|
| 106 |
+
},
|
| 107 |
+
"parameters":{
|
| 108 |
+
"type":"object",
|
| 109 |
+
"properties":{
|
| 110 |
+
"query":{
|
| 111 |
+
"type":"string"
|
| 112 |
+
},
|
| 113 |
+
"region":{
|
| 114 |
+
"type":"string"
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
},
|
| 118 |
+
"data":{
|
| 119 |
+
"type":"array",
|
| 120 |
+
"items":{
|
| 121 |
+
"type":"object"
|
| 122 |
+
}
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
}
|
| 127 |
+
]
|
| 128 |
+
}
|
toolbench/toolenv/tools/Data/real_time_image_search/api.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
from datetime import date, datetime, timedelta
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def search_images(query: str, region: str='us', aspect_ratio: str=None, country: str=None, file_type: str=None, safe_search: bool=None, usage_rights: str=None, color: str=None, size: str=None, time: str=None, type: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get real-time image search results from across the web. Supports all Google Images search filters."
|
| 12 |
+
query: Search query / keyword.
|
| 13 |
+
region: The country / region from which to make the query.
|
| 14 |
+
|
| 15 |
+
**Allowed values:** 2-letter country code, see [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
|
| 16 |
+
**Default:** us.
|
| 17 |
+
aspect_ratio: Find images with a specific aspect ratio.
|
| 18 |
+
|
| 19 |
+
**Allowed values:** *tall, square, wide, panoramic*
|
| 20 |
+
country: Find images published in a specific country / region.
|
| 21 |
+
|
| 22 |
+
**Allowed values:** 2-letter country code, see [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
|
| 23 |
+
file_type: Find images of a specific format / file type.
|
| 24 |
+
|
| 25 |
+
**Allowed values:** *jpg, jpeg, png, gif, svg, webp, ico, raw*
|
| 26 |
+
usage_rights: Find images with specific usage rights / license / copyright.
|
| 27 |
+
|
| 28 |
+
**Allowed values:** *creative_commons, commercial*
|
| 29 |
+
color: Find images with a specific dominant color.
|
| 30 |
+
|
| 31 |
+
**Allowed values:** *red, orange, yellow, green, teal, blue, purple, pink, white, gray, black, brown, full, transparent, grayscale*
|
| 32 |
+
size: Find images of a specific size.
|
| 33 |
+
|
| 34 |
+
**Allowed values:** *large, medium, icon, 400x300+, 640x480+, 800x600+, 1024x768+, 2mp+, 4mp+, 6mp+, 8mp+, 10mp+, 12mp+, 15mp+, 20mp+, 40mp+, 70mp+*
|
| 35 |
+
time: Find images last updated in a specific time range.
|
| 36 |
+
|
| 37 |
+
**Allowed values:** *day, week, month, year*
|
| 38 |
+
type: Find images of a specific type.
|
| 39 |
+
|
| 40 |
+
**Allowed values:** *face, photo, clipart, lineart, animated*
|
| 41 |
+
|
| 42 |
+
"""
|
| 43 |
+
url = f"https://real-time-image-search.p.rapidapi.com/search"
|
| 44 |
+
querystring = {'query': query, }
|
| 45 |
+
if region:
|
| 46 |
+
querystring['region'] = region
|
| 47 |
+
if aspect_ratio:
|
| 48 |
+
querystring['aspect_ratio'] = aspect_ratio
|
| 49 |
+
if country:
|
| 50 |
+
querystring['country'] = country
|
| 51 |
+
if file_type:
|
| 52 |
+
querystring['file_type'] = file_type
|
| 53 |
+
if safe_search:
|
| 54 |
+
querystring['safe_search'] = safe_search
|
| 55 |
+
if usage_rights:
|
| 56 |
+
querystring['usage_rights'] = usage_rights
|
| 57 |
+
if color:
|
| 58 |
+
querystring['color'] = color
|
| 59 |
+
if size:
|
| 60 |
+
querystring['size'] = size
|
| 61 |
+
if time:
|
| 62 |
+
querystring['time'] = time
|
| 63 |
+
if type:
|
| 64 |
+
querystring['type'] = type
|
| 65 |
+
|
| 66 |
+
headers = {
|
| 67 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 68 |
+
"X-RapidAPI-Host": "real-time-image-search.p.rapidapi.com"
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 73 |
+
try:
|
| 74 |
+
observation = response.json()
|
| 75 |
+
except:
|
| 76 |
+
observation = response.text
|
| 77 |
+
return observation
|
| 78 |
+
|