Upload folder using huggingface_hub (part 21)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +8 -0
- toolbench/toolenv/tools/Social/instagram_profile_picture_viewer.json +78 -0
- toolbench/toolenv/tools/Social/instagram_profile_picture_viewer/api.py +29 -0
- toolbench/toolenv/tools/Social/instagram_proxy/api.py +29 -0
- toolbench/toolenv/tools/Social/instagram_saver_download_anything_on_instagram.json +73 -0
- toolbench/toolenv/tools/Social/instagram_scraper/api.py +393 -0
- toolbench/toolenv/tools/Social/instagram_scraper_2022/api.py +800 -0
- toolbench/toolenv/tools/Social/instagram_scraper_2022_v2/api.py +149 -0
- toolbench/toolenv/tools/Social/instagram_scraper_2023/api.py +642 -0
- toolbench/toolenv/tools/Social/instagram_scraper_2023_v2.json +186 -0
- toolbench/toolenv/tools/Social/instagram_scraper_2023_v2/api.py +173 -0
- toolbench/toolenv/tools/Social/instagram_scraper_2023_v3/api.py +153 -0
- toolbench/toolenv/tools/Social/instagram_scraper_v2/api.py +448 -0
- toolbench/toolenv/tools/Social/instagram_scraper_v3/api.py +224 -0
- toolbench/toolenv/tools/Social/instagram_scrapper_bulk.json +0 -0
- toolbench/toolenv/tools/Social/instagram_scrapper_bulk/api.py +71 -0
- toolbench/toolenv/tools/Social/instagram_statistical_analysis.json +316 -0
- toolbench/toolenv/tools/Social/instagram_statistical_analysis/api.py +205 -0
- toolbench/toolenv/tools/Social/instagram_statistics_api.json +0 -0
- toolbench/toolenv/tools/Social/instagram_statistics_api/api.py +299 -0
- toolbench/toolenv/tools/Social/instagram_story_and_highlights_saver.json +50 -0
- toolbench/toolenv/tools/Social/instagram_story_and_highlights_saver/api.py +51 -0
- toolbench/toolenv/tools/Social/instagram_story_downloader_media_downloader.json +77 -0
- toolbench/toolenv/tools/Social/instagram_story_downloader_media_downloader/api.py +74 -0
- toolbench/toolenv/tools/Social/instagram_utils/api.py +52 -0
- toolbench/toolenv/tools/Social/instagram_v10.json +38 -0
- toolbench/toolenv/tools/Social/instagram_v10/api.py +29 -0
- toolbench/toolenv/tools/Social/instagram_v11/api.py +73 -0
- toolbench/toolenv/tools/Social/instagram_v12/api.py +529 -0
- toolbench/toolenv/tools/Social/instagram_v13.json +497 -0
- toolbench/toolenv/tools/Social/instagram_v13/api.py +434 -0
- toolbench/toolenv/tools/Social/instagram_v14/api.py +92 -0
- toolbench/toolenv/tools/Social/instagram_v15/api.py +104 -0
- toolbench/toolenv/tools/Social/instagram_v16/api.py +29 -0
- toolbench/toolenv/tools/Social/instagram_v17/api.py +31 -0
- toolbench/toolenv/tools/Social/instagram_v18/api.py +29 -0
- toolbench/toolenv/tools/Social/instagram_v19/api.py +197 -0
- toolbench/toolenv/tools/Social/instagram_v2.json +136 -0
- toolbench/toolenv/tools/Social/instagram_v2/api.py +140 -0
- toolbench/toolenv/tools/Social/instagram_v20/api.py +449 -0
- toolbench/toolenv/tools/Social/instagram_v3.json +42 -0
- toolbench/toolenv/tools/Social/instagram_v3/api.py +50 -0
- toolbench/toolenv/tools/Social/instagram_v4/api.py +296 -0
- toolbench/toolenv/tools/Social/instagram_v5.json +0 -0
- toolbench/toolenv/tools/Social/instagram_v5/api.py +640 -0
- toolbench/toolenv/tools/Social/instagram_v6.json +404 -0
- toolbench/toolenv/tools/Social/instagram_v6/api.py +350 -0
- toolbench/toolenv/tools/Social/instagram_v7.json +117 -0
- toolbench/toolenv/tools/Social/instagram_v7/api.py +115 -0
- toolbench/toolenv/tools/Social/instagram_v8/api.py +56 -0
.gitattributes
CHANGED
|
@@ -76,3 +76,11 @@ toolbench/toolenv/tools/News_Media/imdb.json filter=lfs diff=lfs merge=lfs -text
|
|
| 76 |
toolbench/toolenv/tools/News_Media/online_movie_database.json filter=lfs diff=lfs merge=lfs -text
|
| 77 |
toolbench/toolenv/tools/News_Media/reuters_business_and_financial_news.json filter=lfs diff=lfs merge=lfs -text
|
| 78 |
toolbench/toolenv/tools/Other/quran_com.json filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
toolbench/toolenv/tools/News_Media/online_movie_database.json filter=lfs diff=lfs merge=lfs -text
|
| 77 |
toolbench/toolenv/tools/News_Media/reuters_business_and_financial_news.json filter=lfs diff=lfs merge=lfs -text
|
| 78 |
toolbench/toolenv/tools/Other/quran_com.json filter=lfs diff=lfs merge=lfs -text
|
| 79 |
+
toolbench/toolenv/tools/Social/kwai.json filter=lfs diff=lfs merge=lfs -text
|
| 80 |
+
toolbench/toolenv/tools/Social/scraptik.json filter=lfs diff=lfs merge=lfs -text
|
| 81 |
+
toolbench/toolenv/tools/Social/twitter_v2.json filter=lfs diff=lfs merge=lfs -text
|
| 82 |
+
toolbench/toolenv/tools/Sports/allsportsapi.json filter=lfs diff=lfs merge=lfs -text
|
| 83 |
+
toolbench/toolenv/tools/Sports/americanfootballapi.json filter=lfs diff=lfs merge=lfs -text
|
| 84 |
+
toolbench/toolenv/tools/Sports/basketapi.json filter=lfs diff=lfs merge=lfs -text
|
| 85 |
+
toolbench/toolenv/tools/Sports/footapi.json filter=lfs diff=lfs merge=lfs -text
|
| 86 |
+
toolbench/toolenv/tools/Sports/football_pro.json filter=lfs diff=lfs merge=lfs -text
|
toolbench/toolenv/tools/Social/instagram_profile_picture_viewer.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name":"Instagram Profile Picture Viewer",
|
| 3 |
+
"tool_description":"Fetch Full HD Profile Picture and Some Basic Details of anyone on Instagram.\n\n\n\n\n\n\n\n\nTags: Instagram Insta Profile Info DP Details Insta DP Insta Profile Photo",
|
| 4 |
+
"title":"Instagram Profile Picture Viewer",
|
| 5 |
+
"pricing":"FREEMIUM",
|
| 6 |
+
"score":{
|
| 7 |
+
"avgServiceLevel":6,
|
| 8 |
+
"avgLatency":3720,
|
| 9 |
+
"avgSuccessRate":6,
|
| 10 |
+
"popularityScore":0.1,
|
| 11 |
+
"__typename":"Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url":"https://rapidapi.com/fatehbrar92/api/instagram-profile-picture-viewer/",
|
| 14 |
+
"host":"instagram-profile-picture-viewer.p.rapidapi.com",
|
| 15 |
+
"api_list":[
|
| 16 |
+
{
|
| 17 |
+
"name":"View Profile Picture",
|
| 18 |
+
"url":"https://instagram-profile-picture-viewer.p.rapidapi.com/",
|
| 19 |
+
"description":"View full HD Profile Picture of anyone on Instagram just using username.",
|
| 20 |
+
"method":"GET",
|
| 21 |
+
"required_parameters":[
|
| 22 |
+
{
|
| 23 |
+
"name":"username",
|
| 24 |
+
"type":"STRING",
|
| 25 |
+
"description":"",
|
| 26 |
+
"default":"instagram"
|
| 27 |
+
}
|
| 28 |
+
],
|
| 29 |
+
"optional_parameters":[],
|
| 30 |
+
"code":"import requests\n\nurl = \"https://instagram-profile-picture-viewer.p.rapidapi.com/\"\nquerystring = {\"username\": username}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-profile-picture-viewer.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 31 |
+
"statuscode":200,
|
| 32 |
+
"body":{
|
| 33 |
+
"is_private":false,
|
| 34 |
+
"bio":"Discover what's next on Instagram 🔎✨",
|
| 35 |
+
"username":"instagram",
|
| 36 |
+
"followers":599144538,
|
| 37 |
+
"is_verified":true,
|
| 38 |
+
"fullname":"Instagram",
|
| 39 |
+
"profile_picture_url":"https://scontent-lga3-2.cdninstagram.com/v/t51.2885-19/281440578_1088265838702675_6233856337905829714_n.jpg?_nc_ht=scontent-lga3-2.cdninstagram.com&_nc_cat=1&_nc_ohc=F2lGqV6zD5kAX_uBn8n&edm=AEF8tYYBAAAA&ccb=7-5&oh=00_AfB8A8Q72vkHJbjRLQUOcUsaQaC1T4IIk9bkyz-1O8chag&oe=63DB8D58&_nc_sid=a9513d"
|
| 40 |
+
},
|
| 41 |
+
"headers":{
|
| 42 |
+
"access-control-allow-credentials":"true",
|
| 43 |
+
"access-control-allow-origin":"*",
|
| 44 |
+
"content-type":"application/json",
|
| 45 |
+
"date":"Sun, 29 Jan 2023 08:49:36 GMT",
|
| 46 |
+
"server":"RapidAPI-1.2.8",
|
| 47 |
+
"x-rapidapi-region":"AWS - ap-southeast-1",
|
| 48 |
+
"x-rapidapi-version":"1.2.8"
|
| 49 |
+
},
|
| 50 |
+
"schema":{
|
| 51 |
+
"type":"object",
|
| 52 |
+
"properties":{
|
| 53 |
+
"is_private":{
|
| 54 |
+
"type":"boolean"
|
| 55 |
+
},
|
| 56 |
+
"bio":{
|
| 57 |
+
"type":"string"
|
| 58 |
+
},
|
| 59 |
+
"username":{
|
| 60 |
+
"type":"string"
|
| 61 |
+
},
|
| 62 |
+
"followers":{
|
| 63 |
+
"type":"integer"
|
| 64 |
+
},
|
| 65 |
+
"is_verified":{
|
| 66 |
+
"type":"boolean"
|
| 67 |
+
},
|
| 68 |
+
"fullname":{
|
| 69 |
+
"type":"string"
|
| 70 |
+
},
|
| 71 |
+
"profile_picture_url":{
|
| 72 |
+
"type":"string"
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
]
|
| 78 |
+
}
|
toolbench/toolenv/tools/Social/instagram_profile_picture_viewer/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 view_profile_picture(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"View full HD Profile Picture of anyone on Instagram just using username."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram-profile-picture-viewer.p.rapidapi.com/"
|
| 15 |
+
querystring = {'username': username, }
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram-profile-picture-viewer.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/Social/instagram_proxy/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 getmediacommentsbycode(url2: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"getMediaCommentsByCode"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram-proxy.p.rapidapi.com/{url2}"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram-proxy.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/Social/instagram_saver_download_anything_on_instagram.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_c98fb3e0-8b43-49db-85ab-762af8951b77",
|
| 3 |
+
"tool_description": "Download Instagram Stories, Reels, IGTV, Videos, Images, Carousel, etc.",
|
| 4 |
+
"home_url": "https://rapidapi.com/eaidoo015-pj8dZiAnLJJ/api/instagram-saver-download-anything-on-instagram/",
|
| 5 |
+
"name": "Instagram Saver - Download Anything on Instagram",
|
| 6 |
+
"title": "Instagram Saver - Download Anything on Instagram",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "Instagram Saver - Download Anything on Instagram",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 41,
|
| 11 |
+
"avgLatency": 20474,
|
| 12 |
+
"avgSuccessRate": 41,
|
| 13 |
+
"popularityScore": 9.8,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "instagram-saver-download-anything-on-instagram.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "Get Hashtag Data",
|
| 20 |
+
"url": "https://instagram-saver-download-anything-on-instagram.p.rapidapi.com/hashtag_data",
|
| 21 |
+
"description": "Retrieve data for the given hashtag.",
|
| 22 |
+
"method": "POST",
|
| 23 |
+
"required_parameters": [],
|
| 24 |
+
"optional_parameters": [
|
| 25 |
+
{
|
| 26 |
+
"name": "tag_name",
|
| 27 |
+
"type": "STRING",
|
| 28 |
+
"description": "",
|
| 29 |
+
"default": "cats"
|
| 30 |
+
}
|
| 31 |
+
],
|
| 32 |
+
"code": "import requests\n\nurl = \"https://instagram-saver-download-anything-on-instagram.p.rapidapi.com/hashtag_data\"\nquerystring = {\"tag_name\": \"cats\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-saver-download-anything-on-instagram.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 33 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-saver-download-anything-on-instagram.p.rapidapi.com/hashtag_data\"\nquerystring = {\"tag_name\": \"cats\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-saver-download-anything-on-instagram.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 34 |
+
"test_endpoint": ""
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"name": "Get Story Data",
|
| 38 |
+
"url": "https://instagram-saver-download-anything-on-instagram.p.rapidapi.com/story_data",
|
| 39 |
+
"description": "Get the data of the story url provided",
|
| 40 |
+
"method": "POST",
|
| 41 |
+
"required_parameters": [
|
| 42 |
+
{
|
| 43 |
+
"name": "url",
|
| 44 |
+
"type": "STRING",
|
| 45 |
+
"description": "",
|
| 46 |
+
"default": "https://www.instagram.com/stories/sydneytalker/3172967078393183189"
|
| 47 |
+
}
|
| 48 |
+
],
|
| 49 |
+
"optional_parameters": [],
|
| 50 |
+
"code": "import requests\n\nurl = \"https://instagram-saver-download-anything-on-instagram.p.rapidapi.com/story_data\"\nquerystring = {\"url\": \"https://www.instagram.com/stories/sydneytalker/3172967078393183189\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-saver-download-anything-on-instagram.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 51 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-saver-download-anything-on-instagram.p.rapidapi.com/story_data\"\nquerystring = {\"url\": \"https://www.instagram.com/stories/sydneytalker/3172967078393183189\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-saver-download-anything-on-instagram.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 52 |
+
"test_endpoint": ""
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
"name": "Get Post Data",
|
| 56 |
+
"url": "https://instagram-saver-download-anything-on-instagram.p.rapidapi.com/post_data",
|
| 57 |
+
"description": "Retrieve comprehensive information about an Instagram post, encompassing a diverse range of content types such as reels, IGTV videos, images, videos, and more.",
|
| 58 |
+
"method": "POST",
|
| 59 |
+
"required_parameters": [
|
| 60 |
+
{
|
| 61 |
+
"name": "shortcode",
|
| 62 |
+
"type": "STRING",
|
| 63 |
+
"description": "",
|
| 64 |
+
"default": "CS8ju3gDkWc"
|
| 65 |
+
}
|
| 66 |
+
],
|
| 67 |
+
"optional_parameters": [],
|
| 68 |
+
"code": "import requests\n\nurl = \"https://instagram-saver-download-anything-on-instagram.p.rapidapi.com/post_data\"\nquerystring = {\"shortcode\": \"CS8ju3gDkWc\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-saver-download-anything-on-instagram.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 69 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-saver-download-anything-on-instagram.p.rapidapi.com/post_data\"\nquerystring = {\"shortcode\": \"CS8ju3gDkWc\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-saver-download-anything-on-instagram.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers, params=querystring)\nprint(response.json())\n",
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 mediainfo_v2(short_code: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get media info from short_code v2"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/media_info_v2"
|
| 15 |
+
querystring = {'short_code': short_code, }
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram-scraper2.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 medias_v2(user_id: str, batch_size: str='30', max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"Get someone's medias v2 version, batch_size range from 1 to 50."
|
| 33 |
+
batch_size: Range from 1 to 50.
|
| 34 |
+
|
| 35 |
+
"""
|
| 36 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/medias_v2"
|
| 37 |
+
querystring = {'user_id': user_id, }
|
| 38 |
+
if batch_size:
|
| 39 |
+
querystring['batch_size'] = batch_size
|
| 40 |
+
if max_id:
|
| 41 |
+
querystring['max_id'] = max_id
|
| 42 |
+
|
| 43 |
+
headers = {
|
| 44 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 45 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 50 |
+
try:
|
| 51 |
+
observation = response.json()
|
| 52 |
+
except:
|
| 53 |
+
observation = response.text
|
| 54 |
+
return observation
|
| 55 |
+
|
| 56 |
+
def medias(user_id: str, batch_size: str='30', next_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 57 |
+
"""
|
| 58 |
+
"Get someone's medias, batch_size range from 1 to 50."
|
| 59 |
+
batch_size: Range from 1 to 50.
|
| 60 |
+
|
| 61 |
+
"""
|
| 62 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/medias"
|
| 63 |
+
querystring = {'user_id': user_id, }
|
| 64 |
+
if batch_size:
|
| 65 |
+
querystring['batch_size'] = batch_size
|
| 66 |
+
if next_cursor:
|
| 67 |
+
querystring['next_cursor'] = next_cursor
|
| 68 |
+
|
| 69 |
+
headers = {
|
| 70 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 71 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 76 |
+
try:
|
| 77 |
+
observation = response.json()
|
| 78 |
+
except:
|
| 79 |
+
observation = response.text
|
| 80 |
+
return observation
|
| 81 |
+
|
| 82 |
+
def userinfo(user_name: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 83 |
+
"""
|
| 84 |
+
"Get instagram user info by user name."
|
| 85 |
+
|
| 86 |
+
"""
|
| 87 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/user_info"
|
| 88 |
+
querystring = {'user_name': user_name, }
|
| 89 |
+
|
| 90 |
+
headers = {
|
| 91 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 92 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 97 |
+
try:
|
| 98 |
+
observation = response.json()
|
| 99 |
+
except:
|
| 100 |
+
observation = response.text
|
| 101 |
+
return observation
|
| 102 |
+
|
| 103 |
+
def locationmedias(location_id: str, batch_size: int=20, next_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 104 |
+
"""
|
| 105 |
+
"Get medias from a specific location. Location id can be found at https://www.instagram.com/explore/locations/. For example https://www.instagram.com/explore/locations/303394066/chicago-union-station/ means location_id is 303394066."
|
| 106 |
+
batch_size: No more than 50.
|
| 107 |
+
|
| 108 |
+
"""
|
| 109 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/location_medias"
|
| 110 |
+
querystring = {'location_id': location_id, }
|
| 111 |
+
if batch_size:
|
| 112 |
+
querystring['batch_size'] = batch_size
|
| 113 |
+
if next_cursor:
|
| 114 |
+
querystring['next_cursor'] = next_cursor
|
| 115 |
+
|
| 116 |
+
headers = {
|
| 117 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 118 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 123 |
+
try:
|
| 124 |
+
observation = response.json()
|
| 125 |
+
except:
|
| 126 |
+
observation = response.text
|
| 127 |
+
return observation
|
| 128 |
+
|
| 129 |
+
def hashtagmediasv2(hash_tag: str, batch_size: int=20, next_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 130 |
+
"""
|
| 131 |
+
"Get correct hashtag medias."
|
| 132 |
+
batch_size: No more than 50.
|
| 133 |
+
|
| 134 |
+
"""
|
| 135 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/hash_tag_medias_v2"
|
| 136 |
+
querystring = {'hash_tag': hash_tag, }
|
| 137 |
+
if batch_size:
|
| 138 |
+
querystring['batch_size'] = batch_size
|
| 139 |
+
if next_cursor:
|
| 140 |
+
querystring['next_cursor'] = next_cursor
|
| 141 |
+
|
| 142 |
+
headers = {
|
| 143 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 144 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 149 |
+
try:
|
| 150 |
+
observation = response.json()
|
| 151 |
+
except:
|
| 152 |
+
observation = response.text
|
| 153 |
+
return observation
|
| 154 |
+
|
| 155 |
+
def searchfollowing(user_id: str, query: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 156 |
+
"""
|
| 157 |
+
"Search someone's following."
|
| 158 |
+
|
| 159 |
+
"""
|
| 160 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/search_following"
|
| 161 |
+
querystring = {'user_id': user_id, 'query': query, }
|
| 162 |
+
|
| 163 |
+
headers = {
|
| 164 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 165 |
+
"X-RapidAPI-Host": "instagram-scraper2.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 |
+
|
| 176 |
+
def searchfollowers(query: str, user_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 177 |
+
"""
|
| 178 |
+
"Search someone's followers."
|
| 179 |
+
|
| 180 |
+
"""
|
| 181 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/search_followers"
|
| 182 |
+
querystring = {'query': query, 'user_id': user_id, }
|
| 183 |
+
|
| 184 |
+
headers = {
|
| 185 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 186 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 191 |
+
try:
|
| 192 |
+
observation = response.json()
|
| 193 |
+
except:
|
| 194 |
+
observation = response.text
|
| 195 |
+
return observation
|
| 196 |
+
|
| 197 |
+
def stories(user_id: str='1154485247', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 198 |
+
"""
|
| 199 |
+
"Get someone's stories."
|
| 200 |
+
user_id: Range from 1 to 40.
|
| 201 |
+
|
| 202 |
+
"""
|
| 203 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/stories"
|
| 204 |
+
querystring = {}
|
| 205 |
+
if user_id:
|
| 206 |
+
querystring['user_id'] = user_id
|
| 207 |
+
|
| 208 |
+
headers = {
|
| 209 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 210 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 215 |
+
try:
|
| 216 |
+
observation = response.json()
|
| 217 |
+
except:
|
| 218 |
+
observation = response.text
|
| 219 |
+
return observation
|
| 220 |
+
|
| 221 |
+
def hashtagmedias(hash_tag: str, next_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 222 |
+
"""
|
| 223 |
+
"Get hashtag medias."
|
| 224 |
+
|
| 225 |
+
"""
|
| 226 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/hash_tag_medias"
|
| 227 |
+
querystring = {'hash_tag': hash_tag, }
|
| 228 |
+
if next_cursor:
|
| 229 |
+
querystring['next_cursor'] = next_cursor
|
| 230 |
+
|
| 231 |
+
headers = {
|
| 232 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 233 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
|
| 237 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 238 |
+
try:
|
| 239 |
+
observation = response.json()
|
| 240 |
+
except:
|
| 241 |
+
observation = response.text
|
| 242 |
+
return observation
|
| 243 |
+
|
| 244 |
+
def following(user_id: str, batch_size: int=12, next_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 245 |
+
"""
|
| 246 |
+
"Get someone's following."
|
| 247 |
+
batch_size: No more than 50.
|
| 248 |
+
|
| 249 |
+
"""
|
| 250 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/following"
|
| 251 |
+
querystring = {'user_id': user_id, }
|
| 252 |
+
if batch_size:
|
| 253 |
+
querystring['batch_size'] = batch_size
|
| 254 |
+
if next_cursor:
|
| 255 |
+
querystring['next_cursor'] = next_cursor
|
| 256 |
+
|
| 257 |
+
headers = {
|
| 258 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 259 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
|
| 263 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 264 |
+
try:
|
| 265 |
+
observation = response.json()
|
| 266 |
+
except:
|
| 267 |
+
observation = response.text
|
| 268 |
+
return observation
|
| 269 |
+
|
| 270 |
+
def followers(user_id: str, batch_size: int=12, next_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 271 |
+
"""
|
| 272 |
+
"Get someone's followers."
|
| 273 |
+
batch_size: No more than 50.
|
| 274 |
+
|
| 275 |
+
"""
|
| 276 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/followers"
|
| 277 |
+
querystring = {'user_id': user_id, }
|
| 278 |
+
if batch_size:
|
| 279 |
+
querystring['batch_size'] = batch_size
|
| 280 |
+
if next_cursor:
|
| 281 |
+
querystring['next_cursor'] = next_cursor
|
| 282 |
+
|
| 283 |
+
headers = {
|
| 284 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 285 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
|
| 289 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 290 |
+
try:
|
| 291 |
+
observation = response.json()
|
| 292 |
+
except:
|
| 293 |
+
observation = response.text
|
| 294 |
+
return observation
|
| 295 |
+
|
| 296 |
+
def medialikers(short_code: str, next_cursor: str=None, batch_size: str='20', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 297 |
+
"""
|
| 298 |
+
"Get media's likers. batch_size range from 1 to 50."
|
| 299 |
+
batch_size: Range from 1 to 50.
|
| 300 |
+
|
| 301 |
+
"""
|
| 302 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/media_likers"
|
| 303 |
+
querystring = {'short_code': short_code, }
|
| 304 |
+
if next_cursor:
|
| 305 |
+
querystring['next_cursor'] = next_cursor
|
| 306 |
+
if batch_size:
|
| 307 |
+
querystring['batch_size'] = batch_size
|
| 308 |
+
|
| 309 |
+
headers = {
|
| 310 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 311 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
|
| 315 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 316 |
+
try:
|
| 317 |
+
observation = response.json()
|
| 318 |
+
except:
|
| 319 |
+
observation = response.text
|
| 320 |
+
return observation
|
| 321 |
+
|
| 322 |
+
def mediacomments(short_code: str, next_cursor: str=None, batch_size: str='20', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 323 |
+
"""
|
| 324 |
+
"Get media's comments"
|
| 325 |
+
batch_size: Range from 1 to 50.
|
| 326 |
+
|
| 327 |
+
"""
|
| 328 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/media_comments"
|
| 329 |
+
querystring = {'short_code': short_code, }
|
| 330 |
+
if next_cursor:
|
| 331 |
+
querystring['next_cursor'] = next_cursor
|
| 332 |
+
if batch_size:
|
| 333 |
+
querystring['batch_size'] = batch_size
|
| 334 |
+
|
| 335 |
+
headers = {
|
| 336 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 337 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
|
| 341 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 342 |
+
try:
|
| 343 |
+
observation = response.json()
|
| 344 |
+
except:
|
| 345 |
+
observation = response.text
|
| 346 |
+
return observation
|
| 347 |
+
|
| 348 |
+
def mediainfo(short_code: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 349 |
+
"""
|
| 350 |
+
"Get media info from short_code"
|
| 351 |
+
|
| 352 |
+
"""
|
| 353 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/media_info"
|
| 354 |
+
querystring = {'short_code': short_code, }
|
| 355 |
+
|
| 356 |
+
headers = {
|
| 357 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 358 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
+
|
| 362 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 363 |
+
try:
|
| 364 |
+
observation = response.json()
|
| 365 |
+
except:
|
| 366 |
+
observation = response.text
|
| 367 |
+
return observation
|
| 368 |
+
|
| 369 |
+
def detailuserinfo(user_name: str='instagram', user_id: str='25025320', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 370 |
+
"""
|
| 371 |
+
"Get detail instagram user info."
|
| 372 |
+
|
| 373 |
+
"""
|
| 374 |
+
url = f"https://instagram-scraper2.p.rapidapi.com/user_info_by_id"
|
| 375 |
+
querystring = {}
|
| 376 |
+
if user_name:
|
| 377 |
+
querystring['user_name'] = user_name
|
| 378 |
+
if user_id:
|
| 379 |
+
querystring['user_id'] = user_id
|
| 380 |
+
|
| 381 |
+
headers = {
|
| 382 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 383 |
+
"X-RapidAPI-Host": "instagram-scraper2.p.rapidapi.com"
|
| 384 |
+
}
|
| 385 |
+
|
| 386 |
+
|
| 387 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 388 |
+
try:
|
| 389 |
+
observation = response.json()
|
| 390 |
+
except:
|
| 391 |
+
observation = response.text
|
| 392 |
+
return observation
|
| 393 |
+
|
toolbench/toolenv/tools/Social/instagram_scraper_2022/api.py
ADDED
|
@@ -0,0 +1,800 @@
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_media_by_location(location_id: int, next_media_ids: str=None, max_id: str=None, next_page: int=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get media by location
|
| 12 |
+
Use end_cursor to get the rest of the data"
|
| 13 |
+
max_id: The value of end_cursor for viewing the posts list
|
| 14 |
+
|
| 15 |
+
"""
|
| 16 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/locations/"
|
| 17 |
+
querystring = {'location_id': location_id, }
|
| 18 |
+
if next_media_ids:
|
| 19 |
+
querystring['next_media_ids'] = next_media_ids
|
| 20 |
+
if max_id:
|
| 21 |
+
querystring['max_id'] = max_id
|
| 22 |
+
if next_page:
|
| 23 |
+
querystring['next_page'] = next_page
|
| 24 |
+
|
| 25 |
+
headers = {
|
| 26 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 27 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 32 |
+
try:
|
| 33 |
+
observation = response.json()
|
| 34 |
+
except:
|
| 35 |
+
observation = response.text
|
| 36 |
+
return observation
|
| 37 |
+
|
| 38 |
+
def get_user_posts(id_user: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 39 |
+
"""
|
| 40 |
+
"Get Instagram user posts. **Max - 12**
|
| 41 |
+
Use end_cursor to get the rest of the data"
|
| 42 |
+
end_cursor: The value of end_cursor for viewing the posts list
|
| 43 |
+
|
| 44 |
+
"""
|
| 45 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/posts/"
|
| 46 |
+
querystring = {'id_user': id_user, }
|
| 47 |
+
if end_cursor:
|
| 48 |
+
querystring['end_cursor'] = end_cursor
|
| 49 |
+
|
| 50 |
+
headers = {
|
| 51 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 52 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 57 |
+
try:
|
| 58 |
+
observation = response.json()
|
| 59 |
+
except:
|
| 60 |
+
observation = response.text
|
| 61 |
+
return observation
|
| 62 |
+
|
| 63 |
+
def get_media_likes_users(shortcode: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 64 |
+
"""
|
| 65 |
+
"Get instagram media likes users. **Max - 12**"
|
| 66 |
+
end_cursor: The value of `end_cursor` for viewing the following list
|
| 67 |
+
|
| 68 |
+
"""
|
| 69 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/likes/"
|
| 70 |
+
querystring = {'shortcode': shortcode, }
|
| 71 |
+
if end_cursor:
|
| 72 |
+
querystring['end_cursor'] = end_cursor
|
| 73 |
+
|
| 74 |
+
headers = {
|
| 75 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 76 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.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 get_igtv_tv(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 88 |
+
"""
|
| 89 |
+
"Get instagram IGTV Media"
|
| 90 |
+
|
| 91 |
+
"""
|
| 92 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/tv_info/"
|
| 93 |
+
querystring = {'shortcode': shortcode, }
|
| 94 |
+
|
| 95 |
+
headers = {
|
| 96 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 97 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 102 |
+
try:
|
| 103 |
+
observation = response.json()
|
| 104 |
+
except:
|
| 105 |
+
observation = response.text
|
| 106 |
+
return observation
|
| 107 |
+
|
| 108 |
+
def get_media_more_data(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 109 |
+
"""
|
| 110 |
+
"Get instagram Media More Data /p/ - /tv/ - /reel/"
|
| 111 |
+
|
| 112 |
+
"""
|
| 113 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/post_info_v2/"
|
| 114 |
+
querystring = {'shortcode': shortcode, }
|
| 115 |
+
|
| 116 |
+
headers = {
|
| 117 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 118 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 123 |
+
try:
|
| 124 |
+
observation = response.json()
|
| 125 |
+
except:
|
| 126 |
+
observation = response.text
|
| 127 |
+
return observation
|
| 128 |
+
|
| 129 |
+
def get_reel_reel(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 130 |
+
"""
|
| 131 |
+
"Get instagram Reel Media"
|
| 132 |
+
|
| 133 |
+
"""
|
| 134 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/reel/"
|
| 135 |
+
querystring = {'shortcode': shortcode, }
|
| 136 |
+
|
| 137 |
+
headers = {
|
| 138 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 139 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 144 |
+
try:
|
| 145 |
+
observation = response.json()
|
| 146 |
+
except:
|
| 147 |
+
observation = response.text
|
| 148 |
+
return observation
|
| 149 |
+
|
| 150 |
+
def get_media_p_tv_reel(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 151 |
+
"""
|
| 152 |
+
"Get instagram Media /p/ - /tv/ - /reel/"
|
| 153 |
+
|
| 154 |
+
"""
|
| 155 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/post_info/"
|
| 156 |
+
querystring = {'shortcode': shortcode, }
|
| 157 |
+
|
| 158 |
+
headers = {
|
| 159 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 160 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 165 |
+
try:
|
| 166 |
+
observation = response.json()
|
| 167 |
+
except:
|
| 168 |
+
observation = response.text
|
| 169 |
+
return observation
|
| 170 |
+
|
| 171 |
+
def no_cors_media_beta(url_media: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 172 |
+
"""
|
| 173 |
+
"Get No CORS Media (File storage time from 6 hours to 24)
|
| 174 |
+
|
| 175 |
+
**Specify a direct link to the media that you received in the response /post_info/, etc.**"
|
| 176 |
+
|
| 177 |
+
"""
|
| 178 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/nocors/"
|
| 179 |
+
querystring = {'url_media': url_media, }
|
| 180 |
+
|
| 181 |
+
headers = {
|
| 182 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 183 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
|
| 187 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 188 |
+
try:
|
| 189 |
+
observation = response.json()
|
| 190 |
+
except:
|
| 191 |
+
observation = response.text
|
| 192 |
+
return observation
|
| 193 |
+
|
| 194 |
+
def get_username_suggestions(name: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 195 |
+
"""
|
| 196 |
+
"Get Instagram Username Suggestions
|
| 197 |
+
`Issues free logins available for registration by the specified name and surname`
|
| 198 |
+
|
| 199 |
+
**With each request, new data**"
|
| 200 |
+
|
| 201 |
+
"""
|
| 202 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/randusername/"
|
| 203 |
+
querystring = {'name': name, }
|
| 204 |
+
|
| 205 |
+
headers = {
|
| 206 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 207 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
|
| 211 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 212 |
+
try:
|
| 213 |
+
observation = response.json()
|
| 214 |
+
except:
|
| 215 |
+
observation = response.text
|
| 216 |
+
return observation
|
| 217 |
+
|
| 218 |
+
def get_user_info_by_username(user: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 219 |
+
"""
|
| 220 |
+
"Get Instagram user info by username"
|
| 221 |
+
|
| 222 |
+
"""
|
| 223 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/info_username/"
|
| 224 |
+
querystring = {'user': user, }
|
| 225 |
+
|
| 226 |
+
headers = {
|
| 227 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 228 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
|
| 232 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 233 |
+
try:
|
| 234 |
+
observation = response.json()
|
| 235 |
+
except:
|
| 236 |
+
observation = response.text
|
| 237 |
+
return observation
|
| 238 |
+
|
| 239 |
+
def checking_the_server(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 240 |
+
"""
|
| 241 |
+
"Checking the server status"
|
| 242 |
+
|
| 243 |
+
"""
|
| 244 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/server/"
|
| 245 |
+
querystring = {}
|
| 246 |
+
|
| 247 |
+
headers = {
|
| 248 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 249 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
|
| 253 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 254 |
+
try:
|
| 255 |
+
observation = response.json()
|
| 256 |
+
except:
|
| 257 |
+
observation = response.text
|
| 258 |
+
return observation
|
| 259 |
+
|
| 260 |
+
def get_similar_accounts(id_user: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 261 |
+
"""
|
| 262 |
+
"Get Instagram Similar Accounts"
|
| 263 |
+
|
| 264 |
+
"""
|
| 265 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/similar_accounts/"
|
| 266 |
+
querystring = {'id_user': id_user, }
|
| 267 |
+
|
| 268 |
+
headers = {
|
| 269 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 270 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
|
| 274 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 275 |
+
try:
|
| 276 |
+
observation = response.json()
|
| 277 |
+
except:
|
| 278 |
+
observation = response.text
|
| 279 |
+
return observation
|
| 280 |
+
|
| 281 |
+
def get_user_reels_posts_by_username(user: str, max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 282 |
+
"""
|
| 283 |
+
"Get Instagram user reels posts by Username. **Max - 10**
|
| 284 |
+
Use end_cursor to get the rest of the data"
|
| 285 |
+
|
| 286 |
+
"""
|
| 287 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/reels_posts_username/"
|
| 288 |
+
querystring = {'user': user, }
|
| 289 |
+
if max_id:
|
| 290 |
+
querystring['max_id'] = max_id
|
| 291 |
+
|
| 292 |
+
headers = {
|
| 293 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 294 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
|
| 298 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 299 |
+
try:
|
| 300 |
+
observation = response.json()
|
| 301 |
+
except:
|
| 302 |
+
observation = response.text
|
| 303 |
+
return observation
|
| 304 |
+
|
| 305 |
+
def get_user_tv_posts(id_user: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 306 |
+
"""
|
| 307 |
+
"Get Instagram user tv posts. **Max - 10**
|
| 308 |
+
Use end_cursor to get the rest of the data"
|
| 309 |
+
end_cursor: The value of end_cursor for viewing the posts list
|
| 310 |
+
|
| 311 |
+
"""
|
| 312 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/tv_posts/"
|
| 313 |
+
querystring = {'id_user': id_user, }
|
| 314 |
+
if end_cursor:
|
| 315 |
+
querystring['end_cursor'] = end_cursor
|
| 316 |
+
|
| 317 |
+
headers = {
|
| 318 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 319 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
|
| 323 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 324 |
+
try:
|
| 325 |
+
observation = response.json()
|
| 326 |
+
except:
|
| 327 |
+
observation = response.text
|
| 328 |
+
return observation
|
| 329 |
+
|
| 330 |
+
def get_user_tv_posts_by_username(user: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 331 |
+
"""
|
| 332 |
+
"Get Instagram user tv posts by Username. **Max - 10**
|
| 333 |
+
Use end_cursor to get the rest of the data"
|
| 334 |
+
|
| 335 |
+
"""
|
| 336 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/tv_posts_username/"
|
| 337 |
+
querystring = {'user': user, }
|
| 338 |
+
if end_cursor:
|
| 339 |
+
querystring['end_cursor'] = end_cursor
|
| 340 |
+
|
| 341 |
+
headers = {
|
| 342 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 343 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 344 |
+
}
|
| 345 |
+
|
| 346 |
+
|
| 347 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 348 |
+
try:
|
| 349 |
+
observation = response.json()
|
| 350 |
+
except:
|
| 351 |
+
observation = response.text
|
| 352 |
+
return observation
|
| 353 |
+
|
| 354 |
+
def get_user_reels_posts(id_user: int, max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 355 |
+
"""
|
| 356 |
+
"Get Instagram user reels posts. **Max - 10**
|
| 357 |
+
Use end_cursor to get the rest of the data"
|
| 358 |
+
max_id: The value of end_cursor for viewing the posts list
|
| 359 |
+
|
| 360 |
+
"""
|
| 361 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/reels_posts/"
|
| 362 |
+
querystring = {'id_user': id_user, }
|
| 363 |
+
if max_id:
|
| 364 |
+
querystring['max_id'] = max_id
|
| 365 |
+
|
| 366 |
+
headers = {
|
| 367 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 368 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
|
| 372 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 373 |
+
try:
|
| 374 |
+
observation = response.json()
|
| 375 |
+
except:
|
| 376 |
+
observation = response.text
|
| 377 |
+
return observation
|
| 378 |
+
|
| 379 |
+
def get_user_web_profile_info_by_username(user: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 380 |
+
"""
|
| 381 |
+
"Get Instagram user Web Profile Info by username"
|
| 382 |
+
|
| 383 |
+
"""
|
| 384 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/web_profile_info/"
|
| 385 |
+
querystring = {'user': user, }
|
| 386 |
+
|
| 387 |
+
headers = {
|
| 388 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 389 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
|
| 393 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 394 |
+
try:
|
| 395 |
+
observation = response.json()
|
| 396 |
+
except:
|
| 397 |
+
observation = response.text
|
| 398 |
+
return observation
|
| 399 |
+
|
| 400 |
+
def search_hashtag(hashtag: str, next_max_id: str=None, next_page: int=None, next_media_ids: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 401 |
+
"""
|
| 402 |
+
"Search by hashtag on Instagram"
|
| 403 |
+
next_max_id: The value of `next_max_id` for viewing the next hashtag list
|
| 404 |
+
next_page: The value of `next_page `for viewing the next hashtag list for `next_max_id`
|
| 405 |
+
next_media_ids: If the response has `next_media_ids`, insert it as an array
|
| 406 |
+
Example: `[2876468579675572954, 2876432403502018778]`
|
| 407 |
+
|
| 408 |
+
"""
|
| 409 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/hashtag/"
|
| 410 |
+
querystring = {'hashtag': hashtag, }
|
| 411 |
+
if next_max_id:
|
| 412 |
+
querystring['next_max_id'] = next_max_id
|
| 413 |
+
if next_page:
|
| 414 |
+
querystring['next_page'] = next_page
|
| 415 |
+
if next_media_ids:
|
| 416 |
+
querystring['next_media_ids'] = next_media_ids
|
| 417 |
+
|
| 418 |
+
headers = {
|
| 419 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 420 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 421 |
+
}
|
| 422 |
+
|
| 423 |
+
|
| 424 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 425 |
+
try:
|
| 426 |
+
observation = response.json()
|
| 427 |
+
except:
|
| 428 |
+
observation = response.text
|
| 429 |
+
return observation
|
| 430 |
+
|
| 431 |
+
def get_user_info_by_id_user(id_user: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 432 |
+
"""
|
| 433 |
+
"Get Instagram user info by id_user"
|
| 434 |
+
|
| 435 |
+
"""
|
| 436 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/info/"
|
| 437 |
+
querystring = {'id_user': id_user, }
|
| 438 |
+
|
| 439 |
+
headers = {
|
| 440 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 441 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
|
| 445 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 446 |
+
try:
|
| 447 |
+
observation = response.json()
|
| 448 |
+
except:
|
| 449 |
+
observation = response.text
|
| 450 |
+
return observation
|
| 451 |
+
|
| 452 |
+
def get_user_posts_by_username(user: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 453 |
+
"""
|
| 454 |
+
"Get Instagram user posts by Username. **Max - 10**
|
| 455 |
+
Use end_cursor to get the rest of the data"
|
| 456 |
+
|
| 457 |
+
"""
|
| 458 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/posts_username/"
|
| 459 |
+
querystring = {'user': user, }
|
| 460 |
+
if end_cursor:
|
| 461 |
+
querystring['end_cursor'] = end_cursor
|
| 462 |
+
|
| 463 |
+
headers = {
|
| 464 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 465 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 466 |
+
}
|
| 467 |
+
|
| 468 |
+
|
| 469 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 470 |
+
try:
|
| 471 |
+
observation = response.json()
|
| 472 |
+
except:
|
| 473 |
+
observation = response.text
|
| 474 |
+
return observation
|
| 475 |
+
|
| 476 |
+
def get_user_stories_by_id_strories_hd(id_user: int, id_stories: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 477 |
+
"""
|
| 478 |
+
"Get stories by id stories and id_user HD Format"
|
| 479 |
+
|
| 480 |
+
"""
|
| 481 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/get_stories_hd/"
|
| 482 |
+
querystring = {'id_user': id_user, 'id_stories': id_stories, }
|
| 483 |
+
|
| 484 |
+
headers = {
|
| 485 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 486 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 487 |
+
}
|
| 488 |
+
|
| 489 |
+
|
| 490 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 491 |
+
try:
|
| 492 |
+
observation = response.json()
|
| 493 |
+
except:
|
| 494 |
+
observation = response.text
|
| 495 |
+
return observation
|
| 496 |
+
|
| 497 |
+
def get_media_comments_users(shortcode: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 498 |
+
"""
|
| 499 |
+
"Get instagram media comments users. **Max - 12**"
|
| 500 |
+
end_cursor: The value of `end_cursor ` for viewing the following list
|
| 501 |
+
|
| 502 |
+
In some cases, `next_min_id ` is returned, you need to enter it in full, example:
|
| 503 |
+
|
| 504 |
+
` {'cached_comments_cursor': '17963428621651302', 'bifilter_token': 'KDsBEABAACgAGAAYABAACAAIAAgAc-dqvad7v8e-pyIb_1y2EW-KR_EWL_V_MZGYGMAGEALDGMXIBSGBAA='}`
|
| 505 |
+
|
| 506 |
+
"""
|
| 507 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/comments/"
|
| 508 |
+
querystring = {'shortcode': shortcode, }
|
| 509 |
+
if end_cursor:
|
| 510 |
+
querystring['end_cursor'] = end_cursor
|
| 511 |
+
|
| 512 |
+
headers = {
|
| 513 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 514 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
|
| 518 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 519 |
+
try:
|
| 520 |
+
observation = response.json()
|
| 521 |
+
except:
|
| 522 |
+
observation = response.text
|
| 523 |
+
return observation
|
| 524 |
+
|
| 525 |
+
def get_user_stories_hd(id_user: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 526 |
+
"""
|
| 527 |
+
"Get instagram user stories HD Format"
|
| 528 |
+
|
| 529 |
+
"""
|
| 530 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/stories_hd/"
|
| 531 |
+
querystring = {'id_user': id_user, }
|
| 532 |
+
|
| 533 |
+
headers = {
|
| 534 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 535 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 536 |
+
}
|
| 537 |
+
|
| 538 |
+
|
| 539 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 540 |
+
try:
|
| 541 |
+
observation = response.json()
|
| 542 |
+
except:
|
| 543 |
+
observation = response.text
|
| 544 |
+
return observation
|
| 545 |
+
|
| 546 |
+
def get_user_stories_by_id_strories(id_stories: int, id_user: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 547 |
+
"""
|
| 548 |
+
"Get stories by id stories and id_user"
|
| 549 |
+
|
| 550 |
+
"""
|
| 551 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/get_stories/"
|
| 552 |
+
querystring = {'id_stories': id_stories, 'id_user': id_user, }
|
| 553 |
+
|
| 554 |
+
headers = {
|
| 555 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 556 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 557 |
+
}
|
| 558 |
+
|
| 559 |
+
|
| 560 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 561 |
+
try:
|
| 562 |
+
observation = response.json()
|
| 563 |
+
except:
|
| 564 |
+
observation = response.text
|
| 565 |
+
return observation
|
| 566 |
+
|
| 567 |
+
def get_user_highlights_by_id_highligt(id_highlight: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 568 |
+
"""
|
| 569 |
+
"Get instagram user highlights by id_highlight.
|
| 570 |
+
|
| 571 |
+
**id_highlight** can be obtained from the request to get the "User Highlights tray"
|
| 572 |
+
|
| 573 |
+
Example:
|
| 574 |
+
|
| 575 |
+
```
|
| 576 |
+
|
| 577 |
+
"tray":
|
| 578 |
+
0:
|
| 579 |
+
"id":"highlight:17860963649200530" //<- this
|
| 580 |
+
"latest_reel_media":1635260532
|
| 581 |
+
"seen":NULL
|
| 582 |
+
.......
|
| 583 |
+
```
|
| 584 |
+
|
| 585 |
+
As a result , id_highlight turns out - **17860963649200530**"
|
| 586 |
+
|
| 587 |
+
"""
|
| 588 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/highlights/"
|
| 589 |
+
querystring = {'id_highlight': id_highlight, }
|
| 590 |
+
|
| 591 |
+
headers = {
|
| 592 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 593 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 594 |
+
}
|
| 595 |
+
|
| 596 |
+
|
| 597 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 598 |
+
try:
|
| 599 |
+
observation = response.json()
|
| 600 |
+
except:
|
| 601 |
+
observation = response.text
|
| 602 |
+
return observation
|
| 603 |
+
|
| 604 |
+
def get_user_id(user: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 605 |
+
"""
|
| 606 |
+
"Get Instagram **user id**"
|
| 607 |
+
|
| 608 |
+
"""
|
| 609 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/user_id/"
|
| 610 |
+
querystring = {'user': user, }
|
| 611 |
+
|
| 612 |
+
headers = {
|
| 613 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 614 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 615 |
+
}
|
| 616 |
+
|
| 617 |
+
|
| 618 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 619 |
+
try:
|
| 620 |
+
observation = response.json()
|
| 621 |
+
except:
|
| 622 |
+
observation = response.text
|
| 623 |
+
return observation
|
| 624 |
+
|
| 625 |
+
def get_user_followers(id_user: int, next_max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 626 |
+
"""
|
| 627 |
+
"Get instagram user followers. **Max - 100**"
|
| 628 |
+
next_max_id: The value of `next_max_id` for viewing the following list
|
| 629 |
+
|
| 630 |
+
"""
|
| 631 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/followers/"
|
| 632 |
+
querystring = {'id_user': id_user, }
|
| 633 |
+
if next_max_id:
|
| 634 |
+
querystring['next_max_id'] = next_max_id
|
| 635 |
+
|
| 636 |
+
headers = {
|
| 637 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 638 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 639 |
+
}
|
| 640 |
+
|
| 641 |
+
|
| 642 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 643 |
+
try:
|
| 644 |
+
observation = response.json()
|
| 645 |
+
except:
|
| 646 |
+
observation = response.text
|
| 647 |
+
return observation
|
| 648 |
+
|
| 649 |
+
def get_user_following(id_user: int, next_max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 650 |
+
"""
|
| 651 |
+
"Get instagram user following. **Max - 100**"
|
| 652 |
+
next_max_id: The value of `next_max_id` for viewing the following list
|
| 653 |
+
|
| 654 |
+
"""
|
| 655 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/following/"
|
| 656 |
+
querystring = {'id_user': id_user, }
|
| 657 |
+
if next_max_id:
|
| 658 |
+
querystring['next_max_id'] = next_max_id
|
| 659 |
+
|
| 660 |
+
headers = {
|
| 661 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 662 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 663 |
+
}
|
| 664 |
+
|
| 665 |
+
|
| 666 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 667 |
+
try:
|
| 668 |
+
observation = response.json()
|
| 669 |
+
except:
|
| 670 |
+
observation = response.text
|
| 671 |
+
return observation
|
| 672 |
+
|
| 673 |
+
def get_user_info_business_account_email_phone(id_user: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 674 |
+
"""
|
| 675 |
+
"Get Instagram user info, Business account (email, phone)"
|
| 676 |
+
|
| 677 |
+
"""
|
| 678 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/business/"
|
| 679 |
+
querystring = {'id_user': id_user, }
|
| 680 |
+
|
| 681 |
+
headers = {
|
| 682 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 683 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 684 |
+
}
|
| 685 |
+
|
| 686 |
+
|
| 687 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 688 |
+
try:
|
| 689 |
+
observation = response.json()
|
| 690 |
+
except:
|
| 691 |
+
observation = response.text
|
| 692 |
+
return observation
|
| 693 |
+
|
| 694 |
+
def search_user(user: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 695 |
+
"""
|
| 696 |
+
"Search User to Instagram"
|
| 697 |
+
|
| 698 |
+
"""
|
| 699 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/search/"
|
| 700 |
+
querystring = {'user': user, }
|
| 701 |
+
|
| 702 |
+
headers = {
|
| 703 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 704 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 705 |
+
}
|
| 706 |
+
|
| 707 |
+
|
| 708 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 709 |
+
try:
|
| 710 |
+
observation = response.json()
|
| 711 |
+
except:
|
| 712 |
+
observation = response.text
|
| 713 |
+
return observation
|
| 714 |
+
|
| 715 |
+
def get_user_tagged(id_user: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 716 |
+
"""
|
| 717 |
+
"Get instagram user tagged. **Max 50**"
|
| 718 |
+
|
| 719 |
+
"""
|
| 720 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/tagged/"
|
| 721 |
+
querystring = {'id_user': id_user, }
|
| 722 |
+
if end_cursor:
|
| 723 |
+
querystring['end_cursor'] = end_cursor
|
| 724 |
+
|
| 725 |
+
headers = {
|
| 726 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 727 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 728 |
+
}
|
| 729 |
+
|
| 730 |
+
|
| 731 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 732 |
+
try:
|
| 733 |
+
observation = response.json()
|
| 734 |
+
except:
|
| 735 |
+
observation = response.text
|
| 736 |
+
return observation
|
| 737 |
+
|
| 738 |
+
def get_user_guides(id_user: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 739 |
+
"""
|
| 740 |
+
"Get instagram user guides. **Max 50**"
|
| 741 |
+
|
| 742 |
+
"""
|
| 743 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/guides/"
|
| 744 |
+
querystring = {'id_user': id_user, }
|
| 745 |
+
|
| 746 |
+
headers = {
|
| 747 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 748 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 749 |
+
}
|
| 750 |
+
|
| 751 |
+
|
| 752 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 753 |
+
try:
|
| 754 |
+
observation = response.json()
|
| 755 |
+
except:
|
| 756 |
+
observation = response.text
|
| 757 |
+
return observation
|
| 758 |
+
|
| 759 |
+
def get_user_highlights_tray(id_user: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 760 |
+
"""
|
| 761 |
+
"Get instagram user highlights tray."
|
| 762 |
+
|
| 763 |
+
"""
|
| 764 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/highlights_tray/"
|
| 765 |
+
querystring = {'id_user': id_user, }
|
| 766 |
+
|
| 767 |
+
headers = {
|
| 768 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 769 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 770 |
+
}
|
| 771 |
+
|
| 772 |
+
|
| 773 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 774 |
+
try:
|
| 775 |
+
observation = response.json()
|
| 776 |
+
except:
|
| 777 |
+
observation = response.text
|
| 778 |
+
return observation
|
| 779 |
+
|
| 780 |
+
def get_user_stories(id_user: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 781 |
+
"""
|
| 782 |
+
"Get instagram user stories"
|
| 783 |
+
|
| 784 |
+
"""
|
| 785 |
+
url = f"https://instagram-scraper-2022.p.rapidapi.com/ig/stories/"
|
| 786 |
+
querystring = {'id_user': id_user, }
|
| 787 |
+
|
| 788 |
+
headers = {
|
| 789 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 790 |
+
"X-RapidAPI-Host": "instagram-scraper-2022.p.rapidapi.com"
|
| 791 |
+
}
|
| 792 |
+
|
| 793 |
+
|
| 794 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 795 |
+
try:
|
| 796 |
+
observation = response.json()
|
| 797 |
+
except:
|
| 798 |
+
observation = response.text
|
| 799 |
+
return observation
|
| 800 |
+
|
toolbench/toolenv/tools/Social/instagram_scraper_2022_v2/api.py
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_user_profile_by_username(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get Instagram user information by username"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram-scraper-20221.p.rapidapi.com/userinfo"
|
| 15 |
+
querystring = {'username': username, }
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram-scraper-20221.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 get_user_id(handle: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"Get Instagram user id"
|
| 33 |
+
|
| 34 |
+
"""
|
| 35 |
+
url = f"https://instagram-scraper-20221.p.rapidapi.com/userid"
|
| 36 |
+
querystring = {'handle': handle, }
|
| 37 |
+
|
| 38 |
+
headers = {
|
| 39 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 40 |
+
"X-RapidAPI-Host": "instagram-scraper-20221.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 get_user_posts(handle: str, max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 52 |
+
"""
|
| 53 |
+
"Get Instagram user posts. Max - 33
|
| 54 |
+
Use end_cursor to get the rest of the data"
|
| 55 |
+
|
| 56 |
+
"""
|
| 57 |
+
url = f"https://instagram-scraper-20221.p.rapidapi.com/posts"
|
| 58 |
+
querystring = {'handle': handle, }
|
| 59 |
+
if max_id:
|
| 60 |
+
querystring['max_id'] = max_id
|
| 61 |
+
|
| 62 |
+
headers = {
|
| 63 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 64 |
+
"X-RapidAPI-Host": "instagram-scraper-20221.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_user_followers(user_id: str, count: str='100', max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 76 |
+
"""
|
| 77 |
+
"Get instagram user followers. Max - 100"
|
| 78 |
+
|
| 79 |
+
"""
|
| 80 |
+
url = f"https://instagram-scraper-20221.p.rapidapi.com/followers"
|
| 81 |
+
querystring = {'user_id': user_id, }
|
| 82 |
+
if count:
|
| 83 |
+
querystring['count'] = count
|
| 84 |
+
if max_id:
|
| 85 |
+
querystring['max_id'] = max_id
|
| 86 |
+
|
| 87 |
+
headers = {
|
| 88 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 89 |
+
"X-RapidAPI-Host": "instagram-scraper-20221.p.rapidapi.com"
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 94 |
+
try:
|
| 95 |
+
observation = response.json()
|
| 96 |
+
except:
|
| 97 |
+
observation = response.text
|
| 98 |
+
return observation
|
| 99 |
+
|
| 100 |
+
def get_user_following(user_id: str, count: str='100', max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 101 |
+
"""
|
| 102 |
+
"Get instagram user following. Max - 100"
|
| 103 |
+
|
| 104 |
+
"""
|
| 105 |
+
url = f"https://instagram-scraper-20221.p.rapidapi.com/following"
|
| 106 |
+
querystring = {'user_id': user_id, }
|
| 107 |
+
if count:
|
| 108 |
+
querystring['count'] = count
|
| 109 |
+
if max_id:
|
| 110 |
+
querystring['max_id'] = max_id
|
| 111 |
+
|
| 112 |
+
headers = {
|
| 113 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 114 |
+
"X-RapidAPI-Host": "instagram-scraper-20221.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 get_post_comments(media_pk: str, min_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 126 |
+
"""
|
| 127 |
+
"Get comments made on a post.
|
| 128 |
+
|
| 129 |
+
Each post has a "pk" key. To get the comments for a post, send the pk value of that post as media_pk in the url as query parameter"
|
| 130 |
+
|
| 131 |
+
"""
|
| 132 |
+
url = f"https://instagram-scraper-20221.p.rapidapi.com/post_comments"
|
| 133 |
+
querystring = {'media_pk': media_pk, }
|
| 134 |
+
if min_id:
|
| 135 |
+
querystring['min_id'] = min_id
|
| 136 |
+
|
| 137 |
+
headers = {
|
| 138 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 139 |
+
"X-RapidAPI-Host": "instagram-scraper-20221.p.rapidapi.com"
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 144 |
+
try:
|
| 145 |
+
observation = response.json()
|
| 146 |
+
except:
|
| 147 |
+
observation = response.text
|
| 148 |
+
return observation
|
| 149 |
+
|
toolbench/toolenv/tools/Social/instagram_scraper_2023/api.py
ADDED
|
@@ -0,0 +1,642 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 post_comments(shortcode: str, end_cursor: str=None, scraperid: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get Instagram user post comments by Instagram shortcode."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/postcomments/{shortcode}/{end_cursor}/{scraperid}"
|
| 15 |
+
querystring = {}
|
| 16 |
+
if end_cursor:
|
| 17 |
+
querystring['end_cursor'] = end_cursor
|
| 18 |
+
if scraperid:
|
| 19 |
+
querystring['scraperid'] = scraperid
|
| 20 |
+
|
| 21 |
+
headers = {
|
| 22 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 23 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.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 location_search(keyword: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 35 |
+
"""
|
| 36 |
+
"Get Instagram locations by keyword."
|
| 37 |
+
|
| 38 |
+
"""
|
| 39 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/searchlocation/{keyword}"
|
| 40 |
+
querystring = {}
|
| 41 |
+
|
| 42 |
+
headers = {
|
| 43 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 44 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.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 user_search(keyword: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 56 |
+
"""
|
| 57 |
+
"Get Instagram users by keyword."
|
| 58 |
+
|
| 59 |
+
"""
|
| 60 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/searchuser/{keyword}"
|
| 61 |
+
querystring = {}
|
| 62 |
+
|
| 63 |
+
headers = {
|
| 64 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 65 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 70 |
+
try:
|
| 71 |
+
observation = response.json()
|
| 72 |
+
except:
|
| 73 |
+
observation = response.text
|
| 74 |
+
return observation
|
| 75 |
+
|
| 76 |
+
def user_following(userid: str, count: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 77 |
+
"""
|
| 78 |
+
"Get Instagram user following by Instagram user id."
|
| 79 |
+
|
| 80 |
+
"""
|
| 81 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/userfollowing/{userid}/{count}/{end_cursor}"
|
| 82 |
+
querystring = {}
|
| 83 |
+
if end_cursor:
|
| 84 |
+
querystring['end_cursor'] = end_cursor
|
| 85 |
+
|
| 86 |
+
headers = {
|
| 87 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 88 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 93 |
+
try:
|
| 94 |
+
observation = response.json()
|
| 95 |
+
except:
|
| 96 |
+
observation = response.text
|
| 97 |
+
return observation
|
| 98 |
+
|
| 99 |
+
def similar_users(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 100 |
+
"""
|
| 101 |
+
"Get similar Instagram users by Instagram user id."
|
| 102 |
+
|
| 103 |
+
"""
|
| 104 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/similarusers/{userid}"
|
| 105 |
+
querystring = {}
|
| 106 |
+
|
| 107 |
+
headers = {
|
| 108 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 109 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 114 |
+
try:
|
| 115 |
+
observation = response.json()
|
| 116 |
+
except:
|
| 117 |
+
observation = response.text
|
| 118 |
+
return observation
|
| 119 |
+
|
| 120 |
+
def user_posts(userid: str, count: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 121 |
+
"""
|
| 122 |
+
"Get Instagram user posts by Instagram user id."
|
| 123 |
+
|
| 124 |
+
"""
|
| 125 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/userposts/{userid}/{count}/{end_cursor}"
|
| 126 |
+
querystring = {}
|
| 127 |
+
if end_cursor:
|
| 128 |
+
querystring['end_cursor'] = end_cursor
|
| 129 |
+
|
| 130 |
+
headers = {
|
| 131 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 132 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 137 |
+
try:
|
| 138 |
+
observation = response.json()
|
| 139 |
+
except:
|
| 140 |
+
observation = response.text
|
| 141 |
+
return observation
|
| 142 |
+
|
| 143 |
+
def user_info_by_user_id(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 144 |
+
"""
|
| 145 |
+
"Get Instagram user information by Instagram user id."
|
| 146 |
+
|
| 147 |
+
"""
|
| 148 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/usercontact/{userid}"
|
| 149 |
+
querystring = {}
|
| 150 |
+
|
| 151 |
+
headers = {
|
| 152 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 153 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 158 |
+
try:
|
| 159 |
+
observation = response.json()
|
| 160 |
+
except:
|
| 161 |
+
observation = response.text
|
| 162 |
+
return observation
|
| 163 |
+
|
| 164 |
+
def user_guide_detail(guideid: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 165 |
+
"""
|
| 166 |
+
"Get Instagram user guide detail by Instagram guide id."
|
| 167 |
+
|
| 168 |
+
"""
|
| 169 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/guidedetail/{guideid}/{end_cursor}"
|
| 170 |
+
querystring = {}
|
| 171 |
+
if end_cursor:
|
| 172 |
+
querystring['end_cursor'] = end_cursor
|
| 173 |
+
|
| 174 |
+
headers = {
|
| 175 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 176 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
|
| 180 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 181 |
+
try:
|
| 182 |
+
observation = response.json()
|
| 183 |
+
except:
|
| 184 |
+
observation = response.text
|
| 185 |
+
return observation
|
| 186 |
+
|
| 187 |
+
def user_guides(count: str, userid: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 188 |
+
"""
|
| 189 |
+
"Get Instagram user guides by Instagram user id."
|
| 190 |
+
|
| 191 |
+
"""
|
| 192 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/userguides/{userid}/{count}/{end_cursor}"
|
| 193 |
+
querystring = {}
|
| 194 |
+
if end_cursor:
|
| 195 |
+
querystring['end_cursor'] = end_cursor
|
| 196 |
+
|
| 197 |
+
headers = {
|
| 198 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 199 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 204 |
+
try:
|
| 205 |
+
observation = response.json()
|
| 206 |
+
except:
|
| 207 |
+
observation = response.text
|
| 208 |
+
return observation
|
| 209 |
+
|
| 210 |
+
def user_tv_channel(userid: str, count: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 211 |
+
"""
|
| 212 |
+
"Get Instagram user tv channel by Instagram user id."
|
| 213 |
+
|
| 214 |
+
"""
|
| 215 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/usertvchannel/{userid}/{count}/{end_cursor}"
|
| 216 |
+
querystring = {}
|
| 217 |
+
if end_cursor:
|
| 218 |
+
querystring['end_cursor'] = end_cursor
|
| 219 |
+
|
| 220 |
+
headers = {
|
| 221 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 222 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 227 |
+
try:
|
| 228 |
+
observation = response.json()
|
| 229 |
+
except:
|
| 230 |
+
observation = response.text
|
| 231 |
+
return observation
|
| 232 |
+
|
| 233 |
+
def user_highlights_list(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 234 |
+
"""
|
| 235 |
+
"Get Instagram user highlights list by Instagram user id."
|
| 236 |
+
|
| 237 |
+
"""
|
| 238 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/userhighlights/{userid}"
|
| 239 |
+
querystring = {}
|
| 240 |
+
|
| 241 |
+
headers = {
|
| 242 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 243 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
|
| 247 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 248 |
+
try:
|
| 249 |
+
observation = response.json()
|
| 250 |
+
except:
|
| 251 |
+
observation = response.text
|
| 252 |
+
return observation
|
| 253 |
+
|
| 254 |
+
def highlight_detail(highlightid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 255 |
+
"""
|
| 256 |
+
"Get Instagram highlight detail by Instagram highlight id."
|
| 257 |
+
|
| 258 |
+
"""
|
| 259 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/highlightdetail/{highlightid}"
|
| 260 |
+
querystring = {}
|
| 261 |
+
|
| 262 |
+
headers = {
|
| 263 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 264 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
|
| 268 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 269 |
+
try:
|
| 270 |
+
observation = response.json()
|
| 271 |
+
except:
|
| 272 |
+
observation = response.text
|
| 273 |
+
return observation
|
| 274 |
+
|
| 275 |
+
def user_profile_picture(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 276 |
+
"""
|
| 277 |
+
"Get Instagram user profile picture by Instagram username."
|
| 278 |
+
|
| 279 |
+
"""
|
| 280 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/userprofilephoto/{username}"
|
| 281 |
+
querystring = {}
|
| 282 |
+
|
| 283 |
+
headers = {
|
| 284 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 285 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
|
| 289 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 290 |
+
try:
|
| 291 |
+
observation = response.json()
|
| 292 |
+
except:
|
| 293 |
+
observation = response.text
|
| 294 |
+
return observation
|
| 295 |
+
|
| 296 |
+
def user_followers(userid: str, count: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 297 |
+
"""
|
| 298 |
+
"Get Instagram user followers by Instagram user id."
|
| 299 |
+
|
| 300 |
+
"""
|
| 301 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/userfollowers/{userid}/{count}/{end_cursor}"
|
| 302 |
+
querystring = {}
|
| 303 |
+
if end_cursor:
|
| 304 |
+
querystring['end_cursor'] = end_cursor
|
| 305 |
+
|
| 306 |
+
headers = {
|
| 307 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 308 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
|
| 312 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 313 |
+
try:
|
| 314 |
+
observation = response.json()
|
| 315 |
+
except:
|
| 316 |
+
observation = response.text
|
| 317 |
+
return observation
|
| 318 |
+
|
| 319 |
+
def user_id(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 320 |
+
"""
|
| 321 |
+
"Get Instagram user id by Instagram username"
|
| 322 |
+
|
| 323 |
+
"""
|
| 324 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/userid/{username}"
|
| 325 |
+
querystring = {}
|
| 326 |
+
|
| 327 |
+
headers = {
|
| 328 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 329 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 330 |
+
}
|
| 331 |
+
|
| 332 |
+
|
| 333 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 334 |
+
try:
|
| 335 |
+
observation = response.json()
|
| 336 |
+
except:
|
| 337 |
+
observation = response.text
|
| 338 |
+
return observation
|
| 339 |
+
|
| 340 |
+
def user_reels(count: str, userid: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 341 |
+
"""
|
| 342 |
+
"Get Instagram user reels by Instagram user id."
|
| 343 |
+
|
| 344 |
+
"""
|
| 345 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/userreels/{userid}/{count}/{end_cursor}"
|
| 346 |
+
querystring = {}
|
| 347 |
+
if end_cursor:
|
| 348 |
+
querystring['end_cursor'] = end_cursor
|
| 349 |
+
|
| 350 |
+
headers = {
|
| 351 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 352 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
|
| 356 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 357 |
+
try:
|
| 358 |
+
observation = response.json()
|
| 359 |
+
except:
|
| 360 |
+
observation = response.text
|
| 361 |
+
return observation
|
| 362 |
+
|
| 363 |
+
def search_location(keyword: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 364 |
+
"""
|
| 365 |
+
"Get Instagram locations by keyword."
|
| 366 |
+
|
| 367 |
+
"""
|
| 368 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/searchlocation/{keyword}"
|
| 369 |
+
querystring = {}
|
| 370 |
+
|
| 371 |
+
headers = {
|
| 372 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 373 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
|
| 377 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 378 |
+
try:
|
| 379 |
+
observation = response.json()
|
| 380 |
+
except:
|
| 381 |
+
observation = response.text
|
| 382 |
+
return observation
|
| 383 |
+
|
| 384 |
+
def search_hashtag(keyword: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 385 |
+
"""
|
| 386 |
+
"Get Instagram hashtags by keyword."
|
| 387 |
+
|
| 388 |
+
"""
|
| 389 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/searchtag/{keyword}"
|
| 390 |
+
querystring = {}
|
| 391 |
+
|
| 392 |
+
headers = {
|
| 393 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 394 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
|
| 398 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 399 |
+
try:
|
| 400 |
+
observation = response.json()
|
| 401 |
+
except:
|
| 402 |
+
observation = response.text
|
| 403 |
+
return observation
|
| 404 |
+
|
| 405 |
+
def search_user(keyword: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 406 |
+
"""
|
| 407 |
+
"Get Instagram users by keyword."
|
| 408 |
+
|
| 409 |
+
"""
|
| 410 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/searchuser/{keyword}"
|
| 411 |
+
querystring = {}
|
| 412 |
+
|
| 413 |
+
headers = {
|
| 414 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 415 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 416 |
+
}
|
| 417 |
+
|
| 418 |
+
|
| 419 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 420 |
+
try:
|
| 421 |
+
observation = response.json()
|
| 422 |
+
except:
|
| 423 |
+
observation = response.text
|
| 424 |
+
return observation
|
| 425 |
+
|
| 426 |
+
def live_broadcast_info(broadcastid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 427 |
+
"""
|
| 428 |
+
"Get Instagram live broadcast info by Instagram broadcas id."
|
| 429 |
+
|
| 430 |
+
"""
|
| 431 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/liveinfo/{broadcastid}"
|
| 432 |
+
querystring = {}
|
| 433 |
+
|
| 434 |
+
headers = {
|
| 435 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 436 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
|
| 440 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 441 |
+
try:
|
| 442 |
+
observation = response.json()
|
| 443 |
+
except:
|
| 444 |
+
observation = response.text
|
| 445 |
+
return observation
|
| 446 |
+
|
| 447 |
+
def music_information(musicid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 448 |
+
"""
|
| 449 |
+
"Get Instagram music information by Instagram audio_cluster_id."
|
| 450 |
+
musicid: audio_cluster_id
|
| 451 |
+
|
| 452 |
+
"""
|
| 453 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/musicinfo/{musicid}"
|
| 454 |
+
querystring = {}
|
| 455 |
+
|
| 456 |
+
headers = {
|
| 457 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 458 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 459 |
+
}
|
| 460 |
+
|
| 461 |
+
|
| 462 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 463 |
+
try:
|
| 464 |
+
observation = response.json()
|
| 465 |
+
except:
|
| 466 |
+
observation = response.text
|
| 467 |
+
return observation
|
| 468 |
+
|
| 469 |
+
def location_information(locationid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 470 |
+
"""
|
| 471 |
+
"Get Instagram location information by Instagram location id."
|
| 472 |
+
|
| 473 |
+
"""
|
| 474 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/locationinfo/{locationid}"
|
| 475 |
+
querystring = {}
|
| 476 |
+
|
| 477 |
+
headers = {
|
| 478 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 479 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
|
| 483 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 484 |
+
try:
|
| 485 |
+
observation = response.json()
|
| 486 |
+
except:
|
| 487 |
+
observation = response.text
|
| 488 |
+
return observation
|
| 489 |
+
|
| 490 |
+
def user_stories(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 491 |
+
"""
|
| 492 |
+
"Get Instagram user stories by Instagram user id."
|
| 493 |
+
|
| 494 |
+
"""
|
| 495 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/userstories/{userid}"
|
| 496 |
+
querystring = {}
|
| 497 |
+
|
| 498 |
+
headers = {
|
| 499 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 500 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 501 |
+
}
|
| 502 |
+
|
| 503 |
+
|
| 504 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 505 |
+
try:
|
| 506 |
+
observation = response.json()
|
| 507 |
+
except:
|
| 508 |
+
observation = response.text
|
| 509 |
+
return observation
|
| 510 |
+
|
| 511 |
+
def user_tagged_posts(userid: str, count: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 512 |
+
"""
|
| 513 |
+
"Get Instagram user tagged posts by Instagram user id."
|
| 514 |
+
|
| 515 |
+
"""
|
| 516 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/usertaggedposts/{userid}/{count}/{end_cursor}"
|
| 517 |
+
querystring = {}
|
| 518 |
+
if end_cursor:
|
| 519 |
+
querystring['end_cursor'] = end_cursor
|
| 520 |
+
|
| 521 |
+
headers = {
|
| 522 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 523 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 524 |
+
}
|
| 525 |
+
|
| 526 |
+
|
| 527 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 528 |
+
try:
|
| 529 |
+
observation = response.json()
|
| 530 |
+
except:
|
| 531 |
+
observation = response.text
|
| 532 |
+
return observation
|
| 533 |
+
|
| 534 |
+
def user_info_by_username(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 535 |
+
"""
|
| 536 |
+
"Get Instagram user information by Instagram username."
|
| 537 |
+
username: Only username.
|
| 538 |
+
Example : instagram
|
| 539 |
+
|
| 540 |
+
"""
|
| 541 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/userinfo/{username}"
|
| 542 |
+
querystring = {}
|
| 543 |
+
|
| 544 |
+
headers = {
|
| 545 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 546 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 547 |
+
}
|
| 548 |
+
|
| 549 |
+
|
| 550 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 551 |
+
try:
|
| 552 |
+
observation = response.json()
|
| 553 |
+
except:
|
| 554 |
+
observation = response.text
|
| 555 |
+
return observation
|
| 556 |
+
|
| 557 |
+
def user_live_broadcast(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 558 |
+
"""
|
| 559 |
+
"Get Instagram user live broadcast by Instagram user id."
|
| 560 |
+
|
| 561 |
+
"""
|
| 562 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/userlive/{userid}"
|
| 563 |
+
querystring = {}
|
| 564 |
+
|
| 565 |
+
headers = {
|
| 566 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 567 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 568 |
+
}
|
| 569 |
+
|
| 570 |
+
|
| 571 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 572 |
+
try:
|
| 573 |
+
observation = response.json()
|
| 574 |
+
except:
|
| 575 |
+
observation = response.text
|
| 576 |
+
return observation
|
| 577 |
+
|
| 578 |
+
def post_likes(shortcode: str, count: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 579 |
+
"""
|
| 580 |
+
"Get Instagram user post likes data by Instagram shortcode."
|
| 581 |
+
|
| 582 |
+
"""
|
| 583 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/postlikes/{shortcode}/{count}/{end_cursor}"
|
| 584 |
+
querystring = {}
|
| 585 |
+
if end_cursor:
|
| 586 |
+
querystring['end_cursor'] = end_cursor
|
| 587 |
+
|
| 588 |
+
headers = {
|
| 589 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 590 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 591 |
+
}
|
| 592 |
+
|
| 593 |
+
|
| 594 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 595 |
+
try:
|
| 596 |
+
observation = response.json()
|
| 597 |
+
except:
|
| 598 |
+
observation = response.text
|
| 599 |
+
return observation
|
| 600 |
+
|
| 601 |
+
def post_detail(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 602 |
+
"""
|
| 603 |
+
"Get Instagram user post detail by Instagram shortcode."
|
| 604 |
+
|
| 605 |
+
"""
|
| 606 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/postdetail/{shortcode}"
|
| 607 |
+
querystring = {}
|
| 608 |
+
|
| 609 |
+
headers = {
|
| 610 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 611 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 612 |
+
}
|
| 613 |
+
|
| 614 |
+
|
| 615 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 616 |
+
try:
|
| 617 |
+
observation = response.json()
|
| 618 |
+
except:
|
| 619 |
+
observation = response.text
|
| 620 |
+
return observation
|
| 621 |
+
|
| 622 |
+
def check_shortcode(shortcode: str, password: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 623 |
+
"""
|
| 624 |
+
"Private"
|
| 625 |
+
|
| 626 |
+
"""
|
| 627 |
+
url = f"https://instagram-scraper-20231.p.rapidapi.com/checkshortcode/{shortcode}/{password}"
|
| 628 |
+
querystring = {}
|
| 629 |
+
|
| 630 |
+
headers = {
|
| 631 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 632 |
+
"X-RapidAPI-Host": "instagram-scraper-20231.p.rapidapi.com"
|
| 633 |
+
}
|
| 634 |
+
|
| 635 |
+
|
| 636 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 637 |
+
try:
|
| 638 |
+
observation = response.json()
|
| 639 |
+
except:
|
| 640 |
+
observation = response.text
|
| 641 |
+
return observation
|
| 642 |
+
|
toolbench/toolenv/tools/Social/instagram_scraper_2023_v2.json
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_fd937e0d-4dbf-4985-b272-0390219f0529",
|
| 3 |
+
"tool_description": "MEGA Instagram Scraper 2023 - get any Instagram stories, Highlights, Posts, Photos and Videos from public profiles by API Test for free :) You can get quick help via telegram app: @insta4root",
|
| 4 |
+
"home_url": "https://rapidapi.com/insta4root/api/instagram-scraper-20233/",
|
| 5 |
+
"name": "Instagram Scraper 2023_v2",
|
| 6 |
+
"title": "Instagram Scraper 2023",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "Instagram Scraper 2023_v2",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 47,
|
| 11 |
+
"avgLatency": 1069,
|
| 12 |
+
"avgSuccessRate": 47,
|
| 13 |
+
"popularityScore": 9.1,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "instagram-scraper-20233.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "Profile IGTV",
|
| 20 |
+
"url": "https://instagram-scraper-20233.p.rapidapi.com/api/profile/igtv_channel",
|
| 21 |
+
"description": "Profile IGTV",
|
| 22 |
+
"method": "GET",
|
| 23 |
+
"required_parameters": [],
|
| 24 |
+
"optional_parameters": [
|
| 25 |
+
{
|
| 26 |
+
"name": "username",
|
| 27 |
+
"type": "STRING",
|
| 28 |
+
"description": "",
|
| 29 |
+
"default": "kimkardashian"
|
| 30 |
+
},
|
| 31 |
+
{
|
| 32 |
+
"name": "nextMaxId",
|
| 33 |
+
"type": "STRING",
|
| 34 |
+
"description": "",
|
| 35 |
+
"default": ""
|
| 36 |
+
}
|
| 37 |
+
],
|
| 38 |
+
"code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/igtv_channel\"\nquerystring = {\"username\": \"kimkardashian\", \"nextMaxId\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 39 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/igtv_channel\"\nquerystring = {\"username\": \"kimkardashian\", \"nextMaxId\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 40 |
+
"test_endpoint": "",
|
| 41 |
+
"statuscode": 200,
|
| 42 |
+
"schema": {
|
| 43 |
+
"type": "object"
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"name": "Profile Publications",
|
| 48 |
+
"url": "https://instagram-scraper-20233.p.rapidapi.com/api/profile/publications",
|
| 49 |
+
"description": "Profile Publications",
|
| 50 |
+
"method": "GET",
|
| 51 |
+
"required_parameters": [],
|
| 52 |
+
"optional_parameters": [
|
| 53 |
+
{
|
| 54 |
+
"name": "username",
|
| 55 |
+
"type": "STRING",
|
| 56 |
+
"description": "",
|
| 57 |
+
"default": "kimkardashian"
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"name": "nextMaxId",
|
| 61 |
+
"type": "STRING",
|
| 62 |
+
"description": "",
|
| 63 |
+
"default": ""
|
| 64 |
+
}
|
| 65 |
+
],
|
| 66 |
+
"code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/publications\"\nquerystring = {\"username\": \"kimkardashian\", \"nextMaxId\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 67 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/publications\"\nquerystring = {\"username\": \"kimkardashian\", \"nextMaxId\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 68 |
+
"test_endpoint": "",
|
| 69 |
+
"statuscode": 200,
|
| 70 |
+
"schema": {
|
| 71 |
+
"type": "object"
|
| 72 |
+
}
|
| 73 |
+
},
|
| 74 |
+
{
|
| 75 |
+
"name": "Profile Highlights",
|
| 76 |
+
"url": "https://instagram-scraper-20233.p.rapidapi.com/api/profile/highlights",
|
| 77 |
+
"description": "Profile Highlights",
|
| 78 |
+
"method": "GET",
|
| 79 |
+
"required_parameters": [],
|
| 80 |
+
"optional_parameters": [
|
| 81 |
+
{
|
| 82 |
+
"name": "username",
|
| 83 |
+
"type": "STRING",
|
| 84 |
+
"description": "",
|
| 85 |
+
"default": "kimkardashian"
|
| 86 |
+
}
|
| 87 |
+
],
|
| 88 |
+
"code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/highlights\"\nquerystring = {\"username\": \"kimkardashian\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 89 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/highlights\"\nquerystring = {\"username\": \"kimkardashian\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 90 |
+
"test_endpoint": "",
|
| 91 |
+
"statuscode": 200,
|
| 92 |
+
"schema": {
|
| 93 |
+
"type": "object"
|
| 94 |
+
}
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"name": "Profile Info",
|
| 98 |
+
"url": "https://instagram-scraper-20233.p.rapidapi.com/api/profile/info",
|
| 99 |
+
"description": "Profile Info",
|
| 100 |
+
"method": "GET",
|
| 101 |
+
"required_parameters": [],
|
| 102 |
+
"optional_parameters": [
|
| 103 |
+
{
|
| 104 |
+
"name": "username",
|
| 105 |
+
"type": "STRING",
|
| 106 |
+
"description": "",
|
| 107 |
+
"default": "kimkardashian"
|
| 108 |
+
}
|
| 109 |
+
],
|
| 110 |
+
"code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/info\"\nquerystring = {\"username\": \"kimkardashian\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 111 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/info\"\nquerystring = {\"username\": \"kimkardashian\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 112 |
+
"test_endpoint": "",
|
| 113 |
+
"statuscode": 200,
|
| 114 |
+
"schema": {
|
| 115 |
+
"type": "object"
|
| 116 |
+
}
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
"name": "Highlight Items",
|
| 120 |
+
"url": "https://instagram-scraper-20233.p.rapidapi.com/api/profile/highlight_items",
|
| 121 |
+
"description": "Highlight Items",
|
| 122 |
+
"method": "GET",
|
| 123 |
+
"required_parameters": [],
|
| 124 |
+
"optional_parameters": [
|
| 125 |
+
{
|
| 126 |
+
"name": "highlightId",
|
| 127 |
+
"type": "STRING",
|
| 128 |
+
"description": "",
|
| 129 |
+
"default": "highlight:18064021144190483"
|
| 130 |
+
}
|
| 131 |
+
],
|
| 132 |
+
"code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/highlight_items\"\nquerystring = {\"highlightId\": \"highlight:18064021144190483\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 133 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/highlight_items\"\nquerystring = {\"highlightId\": \"highlight:18064021144190483\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 134 |
+
"test_endpoint": "",
|
| 135 |
+
"statuscode": 200,
|
| 136 |
+
"schema": {
|
| 137 |
+
"type": "object"
|
| 138 |
+
}
|
| 139 |
+
},
|
| 140 |
+
{
|
| 141 |
+
"name": "Profile Stories",
|
| 142 |
+
"url": "https://instagram-scraper-20233.p.rapidapi.com/api/profile/stories",
|
| 143 |
+
"description": "Profile Stories",
|
| 144 |
+
"method": "GET",
|
| 145 |
+
"required_parameters": [],
|
| 146 |
+
"optional_parameters": [
|
| 147 |
+
{
|
| 148 |
+
"name": "username",
|
| 149 |
+
"type": "STRING",
|
| 150 |
+
"description": "",
|
| 151 |
+
"default": "kimkardashian"
|
| 152 |
+
}
|
| 153 |
+
],
|
| 154 |
+
"code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/stories\"\nquerystring = {\"username\": \"kimkardashian\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 155 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/stories\"\nquerystring = {\"username\": \"kimkardashian\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 156 |
+
"test_endpoint": "",
|
| 157 |
+
"statuscode": 200,
|
| 158 |
+
"schema": {
|
| 159 |
+
"type": "object"
|
| 160 |
+
}
|
| 161 |
+
},
|
| 162 |
+
{
|
| 163 |
+
"name": "Search",
|
| 164 |
+
"url": "https://instagram-scraper-20233.p.rapidapi.com/api/profile/search",
|
| 165 |
+
"description": "Search",
|
| 166 |
+
"method": "GET",
|
| 167 |
+
"required_parameters": [],
|
| 168 |
+
"optional_parameters": [
|
| 169 |
+
{
|
| 170 |
+
"name": "username",
|
| 171 |
+
"type": "STRING",
|
| 172 |
+
"description": "",
|
| 173 |
+
"default": "kim"
|
| 174 |
+
}
|
| 175 |
+
],
|
| 176 |
+
"code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/search\"\nquerystring = {\"username\": \"kim\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 177 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-scraper-20233.p.rapidapi.com/api/profile/search\"\nquerystring = {\"username\": \"kim\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-scraper-20233.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 178 |
+
"test_endpoint": "",
|
| 179 |
+
"statuscode": 200,
|
| 180 |
+
"schema": {
|
| 181 |
+
"type": "object"
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
],
|
| 185 |
+
"standardized_name": "instagram_scraper_2023_v2"
|
| 186 |
+
}
|
toolbench/toolenv/tools/Social/instagram_scraper_2023_v2/api.py
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 profile_igtv(username: str='kimkardashian', nextmaxid: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Profile IGTV"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram-scraper-20233.p.rapidapi.com/api/profile/igtv_channel"
|
| 15 |
+
querystring = {}
|
| 16 |
+
if username:
|
| 17 |
+
querystring['username'] = username
|
| 18 |
+
if nextmaxid:
|
| 19 |
+
querystring['nextMaxId'] = nextmaxid
|
| 20 |
+
|
| 21 |
+
headers = {
|
| 22 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 23 |
+
"X-RapidAPI-Host": "instagram-scraper-20233.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 profile_publications(username: str='kimkardashian', nextmaxid: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 35 |
+
"""
|
| 36 |
+
"Profile Publications"
|
| 37 |
+
|
| 38 |
+
"""
|
| 39 |
+
url = f"https://instagram-scraper-20233.p.rapidapi.com/api/profile/publications"
|
| 40 |
+
querystring = {}
|
| 41 |
+
if username:
|
| 42 |
+
querystring['username'] = username
|
| 43 |
+
if nextmaxid:
|
| 44 |
+
querystring['nextMaxId'] = nextmaxid
|
| 45 |
+
|
| 46 |
+
headers = {
|
| 47 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 48 |
+
"X-RapidAPI-Host": "instagram-scraper-20233.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 profile_highlights(username: str='kimkardashian', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 60 |
+
"""
|
| 61 |
+
"Profile Highlights"
|
| 62 |
+
|
| 63 |
+
"""
|
| 64 |
+
url = f"https://instagram-scraper-20233.p.rapidapi.com/api/profile/highlights"
|
| 65 |
+
querystring = {}
|
| 66 |
+
if username:
|
| 67 |
+
querystring['username'] = username
|
| 68 |
+
|
| 69 |
+
headers = {
|
| 70 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 71 |
+
"X-RapidAPI-Host": "instagram-scraper-20233.p.rapidapi.com"
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 76 |
+
try:
|
| 77 |
+
observation = response.json()
|
| 78 |
+
except:
|
| 79 |
+
observation = response.text
|
| 80 |
+
return observation
|
| 81 |
+
|
| 82 |
+
def profile_info(username: str='kimkardashian', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 83 |
+
"""
|
| 84 |
+
"Profile Info"
|
| 85 |
+
|
| 86 |
+
"""
|
| 87 |
+
url = f"https://instagram-scraper-20233.p.rapidapi.com/api/profile/info"
|
| 88 |
+
querystring = {}
|
| 89 |
+
if username:
|
| 90 |
+
querystring['username'] = username
|
| 91 |
+
|
| 92 |
+
headers = {
|
| 93 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 94 |
+
"X-RapidAPI-Host": "instagram-scraper-20233.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 highlight_items(highlightid: str='highlight:18064021144190483', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 106 |
+
"""
|
| 107 |
+
"Highlight Items"
|
| 108 |
+
|
| 109 |
+
"""
|
| 110 |
+
url = f"https://instagram-scraper-20233.p.rapidapi.com/api/profile/highlight_items"
|
| 111 |
+
querystring = {}
|
| 112 |
+
if highlightid:
|
| 113 |
+
querystring['highlightId'] = highlightid
|
| 114 |
+
|
| 115 |
+
headers = {
|
| 116 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 117 |
+
"X-RapidAPI-Host": "instagram-scraper-20233.p.rapidapi.com"
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 122 |
+
try:
|
| 123 |
+
observation = response.json()
|
| 124 |
+
except:
|
| 125 |
+
observation = response.text
|
| 126 |
+
return observation
|
| 127 |
+
|
| 128 |
+
def profile_stories(username: str='kimkardashian', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 129 |
+
"""
|
| 130 |
+
"Profile Stories"
|
| 131 |
+
|
| 132 |
+
"""
|
| 133 |
+
url = f"https://instagram-scraper-20233.p.rapidapi.com/api/profile/stories"
|
| 134 |
+
querystring = {}
|
| 135 |
+
if username:
|
| 136 |
+
querystring['username'] = username
|
| 137 |
+
|
| 138 |
+
headers = {
|
| 139 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 140 |
+
"X-RapidAPI-Host": "instagram-scraper-20233.p.rapidapi.com"
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
|
| 144 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 145 |
+
try:
|
| 146 |
+
observation = response.json()
|
| 147 |
+
except:
|
| 148 |
+
observation = response.text
|
| 149 |
+
return observation
|
| 150 |
+
|
| 151 |
+
def search(username: str='kim', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 152 |
+
"""
|
| 153 |
+
"Search"
|
| 154 |
+
|
| 155 |
+
"""
|
| 156 |
+
url = f"https://instagram-scraper-20233.p.rapidapi.com/api/profile/search"
|
| 157 |
+
querystring = {}
|
| 158 |
+
if username:
|
| 159 |
+
querystring['username'] = username
|
| 160 |
+
|
| 161 |
+
headers = {
|
| 162 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 163 |
+
"X-RapidAPI-Host": "instagram-scraper-20233.p.rapidapi.com"
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 168 |
+
try:
|
| 169 |
+
observation = response.json()
|
| 170 |
+
except:
|
| 171 |
+
observation = response.text
|
| 172 |
+
return observation
|
| 173 |
+
|
toolbench/toolenv/tools/Social/instagram_scraper_2023_v3/api.py
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_post_comments(media_pk: str, min_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get comments made on a post.
|
| 12 |
+
|
| 13 |
+
Each post has a "pk" key. To get the comments for a post, send the pk value of that post as media_pk in the url as query parameter"
|
| 14 |
+
min_id: The value of next_min_id for viewing the current comments list
|
| 15 |
+
|
| 16 |
+
"""
|
| 17 |
+
url = f"https://instagram-scraper-2023.p.rapidapi.com/post_comments"
|
| 18 |
+
querystring = {'media_pk': media_pk, }
|
| 19 |
+
if min_id:
|
| 20 |
+
querystring['min_id'] = min_id
|
| 21 |
+
|
| 22 |
+
headers = {
|
| 23 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 24 |
+
"X-RapidAPI-Host": "instagram-scraper-2023.p.rapidapi.com"
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 29 |
+
try:
|
| 30 |
+
observation = response.json()
|
| 31 |
+
except:
|
| 32 |
+
observation = response.text
|
| 33 |
+
return observation
|
| 34 |
+
|
| 35 |
+
def get_user_posts(handle: str, max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 36 |
+
"""
|
| 37 |
+
"Get Instagram user posts. Max - 33
|
| 38 |
+
Use end_cursor to get the rest of the data"
|
| 39 |
+
max_id: The value of next_max_id for viewing the current posts
|
| 40 |
+
|
| 41 |
+
"""
|
| 42 |
+
url = f"https://instagram-scraper-2023.p.rapidapi.com/posts"
|
| 43 |
+
querystring = {'handle': handle, }
|
| 44 |
+
if max_id:
|
| 45 |
+
querystring['max_id'] = max_id
|
| 46 |
+
|
| 47 |
+
headers = {
|
| 48 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 49 |
+
"X-RapidAPI-Host": "instagram-scraper-2023.p.rapidapi.com"
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 54 |
+
try:
|
| 55 |
+
observation = response.json()
|
| 56 |
+
except:
|
| 57 |
+
observation = response.text
|
| 58 |
+
return observation
|
| 59 |
+
|
| 60 |
+
def get_user_info_by_username(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 61 |
+
"""
|
| 62 |
+
"Get Instagram user info by username"
|
| 63 |
+
|
| 64 |
+
"""
|
| 65 |
+
url = f"https://instagram-scraper-2023.p.rapidapi.com/userinfo"
|
| 66 |
+
querystring = {'username': username, }
|
| 67 |
+
|
| 68 |
+
headers = {
|
| 69 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 70 |
+
"X-RapidAPI-Host": "instagram-scraper-2023.p.rapidapi.com"
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 75 |
+
try:
|
| 76 |
+
observation = response.json()
|
| 77 |
+
except:
|
| 78 |
+
observation = response.text
|
| 79 |
+
return observation
|
| 80 |
+
|
| 81 |
+
def get_user_followers(user_id: str, max_id: str=None, count: str='100', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 82 |
+
"""
|
| 83 |
+
"Get instagram user followers. Max - 100"
|
| 84 |
+
max_id: The value of next_max_id for viewing the followers list
|
| 85 |
+
|
| 86 |
+
"""
|
| 87 |
+
url = f"https://instagram-scraper-2023.p.rapidapi.com/followers"
|
| 88 |
+
querystring = {'user_id': user_id, }
|
| 89 |
+
if max_id:
|
| 90 |
+
querystring['max_id'] = max_id
|
| 91 |
+
if count:
|
| 92 |
+
querystring['count'] = count
|
| 93 |
+
|
| 94 |
+
headers = {
|
| 95 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 96 |
+
"X-RapidAPI-Host": "instagram-scraper-2023.p.rapidapi.com"
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 101 |
+
try:
|
| 102 |
+
observation = response.json()
|
| 103 |
+
except:
|
| 104 |
+
observation = response.text
|
| 105 |
+
return observation
|
| 106 |
+
|
| 107 |
+
def get_user_following(user_id: str, max_id: str=None, count: str='100', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 108 |
+
"""
|
| 109 |
+
"Get instagram user following. Max - 100"
|
| 110 |
+
count: The value of next_max_id for viewing the following list
|
| 111 |
+
|
| 112 |
+
"""
|
| 113 |
+
url = f"https://instagram-scraper-2023.p.rapidapi.com/following"
|
| 114 |
+
querystring = {'user_id': user_id, }
|
| 115 |
+
if max_id:
|
| 116 |
+
querystring['max_id'] = max_id
|
| 117 |
+
if count:
|
| 118 |
+
querystring['count'] = count
|
| 119 |
+
|
| 120 |
+
headers = {
|
| 121 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 122 |
+
"X-RapidAPI-Host": "instagram-scraper-2023.p.rapidapi.com"
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 127 |
+
try:
|
| 128 |
+
observation = response.json()
|
| 129 |
+
except:
|
| 130 |
+
observation = response.text
|
| 131 |
+
return observation
|
| 132 |
+
|
| 133 |
+
def get_user_id(handle: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 134 |
+
"""
|
| 135 |
+
"Get Instagram user id"
|
| 136 |
+
|
| 137 |
+
"""
|
| 138 |
+
url = f"https://instagram-scraper-2023.p.rapidapi.com/userid"
|
| 139 |
+
querystring = {'handle': handle, }
|
| 140 |
+
|
| 141 |
+
headers = {
|
| 142 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 143 |
+
"X-RapidAPI-Host": "instagram-scraper-2023.p.rapidapi.com"
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
|
| 147 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 148 |
+
try:
|
| 149 |
+
observation = response.json()
|
| 150 |
+
except:
|
| 151 |
+
observation = response.text
|
| 152 |
+
return observation
|
| 153 |
+
|
toolbench/toolenv/tools/Social/instagram_scraper_v2/api.py
ADDED
|
@@ -0,0 +1,448 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 post_comments(shortcode: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get instagram user post comments data by shortcode."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/post_comment/{shortcode}/{end_cursor}"
|
| 15 |
+
querystring = {}
|
| 16 |
+
if end_cursor:
|
| 17 |
+
querystring['end_cursor'] = end_cursor
|
| 18 |
+
|
| 19 |
+
headers = {
|
| 20 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 21 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 26 |
+
try:
|
| 27 |
+
observation = response.json()
|
| 28 |
+
except:
|
| 29 |
+
observation = response.text
|
| 30 |
+
return observation
|
| 31 |
+
|
| 32 |
+
def reel_detail(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 33 |
+
"""
|
| 34 |
+
"Get instagram user reel detail by shortcode."
|
| 35 |
+
|
| 36 |
+
"""
|
| 37 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/reel_info/{shortcode}"
|
| 38 |
+
querystring = {}
|
| 39 |
+
|
| 40 |
+
headers = {
|
| 41 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 42 |
+
"X-RapidAPI-Host": "instagram-scraper5.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 user_following(count: int, userid: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 54 |
+
"""
|
| 55 |
+
"Get instagram user following by user id."
|
| 56 |
+
|
| 57 |
+
"""
|
| 58 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_following/{userid}/{count}/{end_cursor}"
|
| 59 |
+
querystring = {}
|
| 60 |
+
if end_cursor:
|
| 61 |
+
querystring['end_cursor'] = end_cursor
|
| 62 |
+
|
| 63 |
+
headers = {
|
| 64 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 65 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 70 |
+
try:
|
| 71 |
+
observation = response.json()
|
| 72 |
+
except:
|
| 73 |
+
observation = response.text
|
| 74 |
+
return observation
|
| 75 |
+
|
| 76 |
+
def user_tv_channel(userid: str, count: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 77 |
+
"""
|
| 78 |
+
"Get instagram user tv channel by user id."
|
| 79 |
+
|
| 80 |
+
"""
|
| 81 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_tv/{userid}/{count}/{end_cursor}"
|
| 82 |
+
querystring = {}
|
| 83 |
+
if end_cursor:
|
| 84 |
+
querystring['end_cursor'] = end_cursor
|
| 85 |
+
|
| 86 |
+
headers = {
|
| 87 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 88 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 93 |
+
try:
|
| 94 |
+
observation = response.json()
|
| 95 |
+
except:
|
| 96 |
+
observation = response.text
|
| 97 |
+
return observation
|
| 98 |
+
|
| 99 |
+
def user_profile_picture(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 100 |
+
"""
|
| 101 |
+
"Get instagram user profile picture by username."
|
| 102 |
+
|
| 103 |
+
"""
|
| 104 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_photo/{username}"
|
| 105 |
+
querystring = {}
|
| 106 |
+
|
| 107 |
+
headers = {
|
| 108 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 109 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 114 |
+
try:
|
| 115 |
+
observation = response.json()
|
| 116 |
+
except:
|
| 117 |
+
observation = response.text
|
| 118 |
+
return observation
|
| 119 |
+
|
| 120 |
+
def user_posts(userid: str, count: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 121 |
+
"""
|
| 122 |
+
"Get instagram user posts by user id."
|
| 123 |
+
|
| 124 |
+
"""
|
| 125 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_post/{userid}/{count}/{end_cursor}"
|
| 126 |
+
querystring = {}
|
| 127 |
+
if end_cursor:
|
| 128 |
+
querystring['end_cursor'] = end_cursor
|
| 129 |
+
|
| 130 |
+
headers = {
|
| 131 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 132 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 137 |
+
try:
|
| 138 |
+
observation = response.json()
|
| 139 |
+
except:
|
| 140 |
+
observation = response.text
|
| 141 |
+
return observation
|
| 142 |
+
|
| 143 |
+
def user_stories(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 144 |
+
"""
|
| 145 |
+
"Get instagram user stories by user id."
|
| 146 |
+
|
| 147 |
+
"""
|
| 148 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_stories/{userid}"
|
| 149 |
+
querystring = {}
|
| 150 |
+
|
| 151 |
+
headers = {
|
| 152 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 153 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 158 |
+
try:
|
| 159 |
+
observation = response.json()
|
| 160 |
+
except:
|
| 161 |
+
observation = response.text
|
| 162 |
+
return observation
|
| 163 |
+
|
| 164 |
+
def user_tagged_posts(userid: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 165 |
+
"""
|
| 166 |
+
"Get instagram user tagged posts by user id."
|
| 167 |
+
|
| 168 |
+
"""
|
| 169 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_tagpost/{userid}/{end_cursor}"
|
| 170 |
+
querystring = {}
|
| 171 |
+
if end_cursor:
|
| 172 |
+
querystring['end_cursor'] = end_cursor
|
| 173 |
+
|
| 174 |
+
headers = {
|
| 175 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 176 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
|
| 180 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 181 |
+
try:
|
| 182 |
+
observation = response.json()
|
| 183 |
+
except:
|
| 184 |
+
observation = response.text
|
| 185 |
+
return observation
|
| 186 |
+
|
| 187 |
+
def user_contact_info(userid: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 188 |
+
"""
|
| 189 |
+
"Get instagram user contact info by user id."
|
| 190 |
+
|
| 191 |
+
"""
|
| 192 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_contact/{userid}"
|
| 193 |
+
querystring = {}
|
| 194 |
+
|
| 195 |
+
headers = {
|
| 196 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 197 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
|
| 201 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 202 |
+
try:
|
| 203 |
+
observation = response.json()
|
| 204 |
+
except:
|
| 205 |
+
observation = response.text
|
| 206 |
+
return observation
|
| 207 |
+
|
| 208 |
+
def user_information(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 209 |
+
"""
|
| 210 |
+
"Get instagram user info by username."
|
| 211 |
+
|
| 212 |
+
"""
|
| 213 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_info/{username}"
|
| 214 |
+
querystring = {}
|
| 215 |
+
|
| 216 |
+
headers = {
|
| 217 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 218 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
|
| 222 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 223 |
+
try:
|
| 224 |
+
observation = response.json()
|
| 225 |
+
except:
|
| 226 |
+
observation = response.text
|
| 227 |
+
return observation
|
| 228 |
+
|
| 229 |
+
def post_testing(url: str='CqBDf3tLVc_', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 230 |
+
"""
|
| 231 |
+
"Post Private"
|
| 232 |
+
|
| 233 |
+
"""
|
| 234 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/{url}"
|
| 235 |
+
querystring = {}
|
| 236 |
+
if url:
|
| 237 |
+
querystring['url'] = url
|
| 238 |
+
|
| 239 |
+
headers = {
|
| 240 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 241 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
+
|
| 245 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 246 |
+
try:
|
| 247 |
+
observation = response.json()
|
| 248 |
+
except:
|
| 249 |
+
observation = response.text
|
| 250 |
+
return observation
|
| 251 |
+
|
| 252 |
+
def user_similar_accounts(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 253 |
+
"""
|
| 254 |
+
"Get similar Instagram users by userid."
|
| 255 |
+
|
| 256 |
+
"""
|
| 257 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_similaraccounts/{userid}"
|
| 258 |
+
querystring = {}
|
| 259 |
+
|
| 260 |
+
headers = {
|
| 261 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 262 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
|
| 266 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 267 |
+
try:
|
| 268 |
+
observation = response.json()
|
| 269 |
+
except:
|
| 270 |
+
observation = response.text
|
| 271 |
+
return observation
|
| 272 |
+
|
| 273 |
+
def user_guide_detail(guideid: str, next_max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 274 |
+
"""
|
| 275 |
+
"Get instagram user guide detail by guide id."
|
| 276 |
+
|
| 277 |
+
"""
|
| 278 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_guidedetail/{guideid}/{next_max_id}"
|
| 279 |
+
querystring = {}
|
| 280 |
+
if next_max_id:
|
| 281 |
+
querystring['next_max_id'] = next_max_id
|
| 282 |
+
|
| 283 |
+
headers = {
|
| 284 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 285 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
|
| 289 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 290 |
+
try:
|
| 291 |
+
observation = response.json()
|
| 292 |
+
except:
|
| 293 |
+
observation = response.text
|
| 294 |
+
return observation
|
| 295 |
+
|
| 296 |
+
def user_highlights_list(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 297 |
+
"""
|
| 298 |
+
"Get instagram user highlights list by user id."
|
| 299 |
+
|
| 300 |
+
"""
|
| 301 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_highlightslist/{userid}"
|
| 302 |
+
querystring = {}
|
| 303 |
+
|
| 304 |
+
headers = {
|
| 305 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 306 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
|
| 310 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 311 |
+
try:
|
| 312 |
+
observation = response.json()
|
| 313 |
+
except:
|
| 314 |
+
observation = response.text
|
| 315 |
+
return observation
|
| 316 |
+
|
| 317 |
+
def post_detail(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 318 |
+
"""
|
| 319 |
+
"Get instagram user post detail by shortcode."
|
| 320 |
+
|
| 321 |
+
"""
|
| 322 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/post_info/{shortcode}"
|
| 323 |
+
querystring = {}
|
| 324 |
+
|
| 325 |
+
headers = {
|
| 326 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 327 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
|
| 331 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 332 |
+
try:
|
| 333 |
+
observation = response.json()
|
| 334 |
+
except:
|
| 335 |
+
observation = response.text
|
| 336 |
+
return observation
|
| 337 |
+
|
| 338 |
+
def post_likes(shortcode: str, count: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 339 |
+
"""
|
| 340 |
+
"Get instagram user post likes data by shortcode."
|
| 341 |
+
|
| 342 |
+
"""
|
| 343 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/post_like/{shortcode}/{count}/{end_cursor}"
|
| 344 |
+
querystring = {}
|
| 345 |
+
if end_cursor:
|
| 346 |
+
querystring['end_cursor'] = end_cursor
|
| 347 |
+
|
| 348 |
+
headers = {
|
| 349 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 350 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 351 |
+
}
|
| 352 |
+
|
| 353 |
+
|
| 354 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 355 |
+
try:
|
| 356 |
+
observation = response.json()
|
| 357 |
+
except:
|
| 358 |
+
observation = response.text
|
| 359 |
+
return observation
|
| 360 |
+
|
| 361 |
+
def user_followers(count: int, userid: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 362 |
+
"""
|
| 363 |
+
"Get instagram user followers by user id."
|
| 364 |
+
|
| 365 |
+
"""
|
| 366 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_followers/{userid}/{count}/{end_cursor}"
|
| 367 |
+
querystring = {}
|
| 368 |
+
if end_cursor:
|
| 369 |
+
querystring['end_cursor'] = end_cursor
|
| 370 |
+
|
| 371 |
+
headers = {
|
| 372 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 373 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
|
| 377 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 378 |
+
try:
|
| 379 |
+
observation = response.json()
|
| 380 |
+
except:
|
| 381 |
+
observation = response.text
|
| 382 |
+
return observation
|
| 383 |
+
|
| 384 |
+
def user_guides(userid: str, count: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 385 |
+
"""
|
| 386 |
+
"Get instagram user guides by user id."
|
| 387 |
+
|
| 388 |
+
"""
|
| 389 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_guides/{userid}/{count}/{end_cursor}"
|
| 390 |
+
querystring = {}
|
| 391 |
+
if end_cursor:
|
| 392 |
+
querystring['end_cursor'] = end_cursor
|
| 393 |
+
|
| 394 |
+
headers = {
|
| 395 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 396 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 397 |
+
}
|
| 398 |
+
|
| 399 |
+
|
| 400 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 401 |
+
try:
|
| 402 |
+
observation = response.json()
|
| 403 |
+
except:
|
| 404 |
+
observation = response.text
|
| 405 |
+
return observation
|
| 406 |
+
|
| 407 |
+
def user_highlight_detail(highlightid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 408 |
+
"""
|
| 409 |
+
"Get instagram user highlight detail by highlight id."
|
| 410 |
+
|
| 411 |
+
"""
|
| 412 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_highlightdetail/{highlightid}"
|
| 413 |
+
querystring = {}
|
| 414 |
+
|
| 415 |
+
headers = {
|
| 416 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 417 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
|
| 421 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 422 |
+
try:
|
| 423 |
+
observation = response.json()
|
| 424 |
+
except:
|
| 425 |
+
observation = response.text
|
| 426 |
+
return observation
|
| 427 |
+
|
| 428 |
+
def user_id(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 429 |
+
"""
|
| 430 |
+
"Get instagram user id by username"
|
| 431 |
+
|
| 432 |
+
"""
|
| 433 |
+
url = f"https://instagram-scraper5.p.rapidapi.com/ig/user_id/{username}"
|
| 434 |
+
querystring = {}
|
| 435 |
+
|
| 436 |
+
headers = {
|
| 437 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 438 |
+
"X-RapidAPI-Host": "instagram-scraper5.p.rapidapi.com"
|
| 439 |
+
}
|
| 440 |
+
|
| 441 |
+
|
| 442 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 443 |
+
try:
|
| 444 |
+
observation = response.json()
|
| 445 |
+
except:
|
| 446 |
+
observation = response.text
|
| 447 |
+
return observation
|
| 448 |
+
|
toolbench/toolenv/tools/Social/instagram_scraper_v3/api.py
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 searchusers(query: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Return a list of users based on the query."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram-scraper.p.rapidapi.com/api/v1/users"
|
| 15 |
+
querystring = {'query': query, }
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram-scraper.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 searchhashtags(query: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"Return a list de tags based on the query."
|
| 33 |
+
|
| 34 |
+
"""
|
| 35 |
+
url = f"https://instagram-scraper.p.rapidapi.com/api/v1/hashtags"
|
| 36 |
+
querystring = {'query': query, }
|
| 37 |
+
|
| 38 |
+
headers = {
|
| 39 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 40 |
+
"X-RapidAPI-Host": "instagram-scraper.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 searchlocations(query: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 52 |
+
"""
|
| 53 |
+
"Return a list of locations based on query."
|
| 54 |
+
|
| 55 |
+
"""
|
| 56 |
+
url = f"https://instagram-scraper.p.rapidapi.com/api/v1/locations"
|
| 57 |
+
querystring = {'query': query, }
|
| 58 |
+
|
| 59 |
+
headers = {
|
| 60 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 61 |
+
"X-RapidAPI-Host": "instagram-scraper.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 getmediasbylocation(facebook_place_id: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 73 |
+
"""
|
| 74 |
+
"Return last 50 medias use a location."
|
| 75 |
+
facebook_place_id: Use getLocationSearch to identify a **Facebook Place Id** if you don't have.
|
| 76 |
+
|
| 77 |
+
"""
|
| 78 |
+
url = f"https://instagram-scraper.p.rapidapi.com/api/v1/location_medias"
|
| 79 |
+
querystring = {'facebook_place_id': facebook_place_id, }
|
| 80 |
+
|
| 81 |
+
headers = {
|
| 82 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 83 |
+
"X-RapidAPI-Host": "instagram-scraper.p.rapidapi.com"
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 88 |
+
try:
|
| 89 |
+
observation = response.json()
|
| 90 |
+
except:
|
| 91 |
+
observation = response.text
|
| 92 |
+
return observation
|
| 93 |
+
|
| 94 |
+
def getmediasbyhashtag(query: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 95 |
+
"""
|
| 96 |
+
"Return last 65 medias use a hashtag."
|
| 97 |
+
|
| 98 |
+
"""
|
| 99 |
+
url = f"https://instagram-scraper.p.rapidapi.com/api/v1/hashtag_medias"
|
| 100 |
+
querystring = {'query': query, }
|
| 101 |
+
|
| 102 |
+
headers = {
|
| 103 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 104 |
+
"X-RapidAPI-Host": "instagram-scraper.p.rapidapi.com"
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 109 |
+
try:
|
| 110 |
+
observation = response.json()
|
| 111 |
+
except:
|
| 112 |
+
observation = response.text
|
| 113 |
+
return observation
|
| 114 |
+
|
| 115 |
+
def getmediabyurl(url: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 116 |
+
"""
|
| 117 |
+
"Returns all public data for a media by URL."
|
| 118 |
+
|
| 119 |
+
"""
|
| 120 |
+
url = f"https://instagram-scraper.p.rapidapi.com/api/v1/media_url"
|
| 121 |
+
querystring = {'url': url, }
|
| 122 |
+
|
| 123 |
+
headers = {
|
| 124 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 125 |
+
"X-RapidAPI-Host": "instagram-scraper.p.rapidapi.com"
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 130 |
+
try:
|
| 131 |
+
observation = response.json()
|
| 132 |
+
except:
|
| 133 |
+
observation = response.text
|
| 134 |
+
return observation
|
| 135 |
+
|
| 136 |
+
def getmediabycode(code: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 137 |
+
"""
|
| 138 |
+
"Returns all public data for a media by shortcode."
|
| 139 |
+
|
| 140 |
+
"""
|
| 141 |
+
url = f"https://instagram-scraper.p.rapidapi.com/api/v1/media_code"
|
| 142 |
+
querystring = {'code': code, }
|
| 143 |
+
|
| 144 |
+
headers = {
|
| 145 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 146 |
+
"X-RapidAPI-Host": "instagram-scraper.p.rapidapi.com"
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 151 |
+
try:
|
| 152 |
+
observation = response.json()
|
| 153 |
+
except:
|
| 154 |
+
observation = response.text
|
| 155 |
+
return observation
|
| 156 |
+
|
| 157 |
+
def getmedias(user_id: int, limit: int=None, after_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 158 |
+
"""
|
| 159 |
+
"Returns the list of posts for a profile in list."
|
| 160 |
+
limit: Default **40** items
|
| 161 |
+
|
| 162 |
+
"""
|
| 163 |
+
url = f"https://instagram-scraper.p.rapidapi.com/api/v1/medias"
|
| 164 |
+
querystring = {'user_id': user_id, }
|
| 165 |
+
if limit:
|
| 166 |
+
querystring['limit'] = limit
|
| 167 |
+
if after_cursor:
|
| 168 |
+
querystring['after_cursor'] = after_cursor
|
| 169 |
+
|
| 170 |
+
headers = {
|
| 171 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 172 |
+
"X-RapidAPI-Host": "instagram-scraper.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 getprofilebyurl(url: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 184 |
+
"""
|
| 185 |
+
"Returns general public information about a profile by url."
|
| 186 |
+
|
| 187 |
+
"""
|
| 188 |
+
url = f"https://instagram-scraper.p.rapidapi.com/api/v1/account_url"
|
| 189 |
+
querystring = {'url': url, }
|
| 190 |
+
|
| 191 |
+
headers = {
|
| 192 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 193 |
+
"X-RapidAPI-Host": "instagram-scraper.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 |
+
|
| 204 |
+
def getprofilebyusername(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 205 |
+
"""
|
| 206 |
+
"Returns general public information about a profile."
|
| 207 |
+
|
| 208 |
+
"""
|
| 209 |
+
url = f"https://instagram-scraper.p.rapidapi.com/api/v1/account_username"
|
| 210 |
+
querystring = {'username': username, }
|
| 211 |
+
|
| 212 |
+
headers = {
|
| 213 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 214 |
+
"X-RapidAPI-Host": "instagram-scraper.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 |
+
|
toolbench/toolenv/tools/Social/instagram_scrapper_bulk.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
toolbench/toolenv/tools/Social/instagram_scrapper_bulk/api.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 instagram_post_data(code: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get media post by post shortCode or URL"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram-scrapper-bulk.p.rapidapi.com/media/{code}"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram-scrapper-bulk.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 instagram_last_feed(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"Get instagram feed, last 12 posts from username"
|
| 33 |
+
|
| 34 |
+
"""
|
| 35 |
+
url = f"https://instagram-scrapper-bulk.p.rapidapi.com/feed/{username}"
|
| 36 |
+
querystring = {}
|
| 37 |
+
|
| 38 |
+
headers = {
|
| 39 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 40 |
+
"X-RapidAPI-Host": "instagram-scrapper-bulk.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 full_instagram_profile(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 52 |
+
"""
|
| 53 |
+
"Scrap instagram profile by username"
|
| 54 |
+
|
| 55 |
+
"""
|
| 56 |
+
url = f"https://instagram-scrapper-bulk.p.rapidapi.com/profile/{username}"
|
| 57 |
+
querystring = {}
|
| 58 |
+
|
| 59 |
+
headers = {
|
| 60 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 61 |
+
"X-RapidAPI-Host": "instagram-scrapper-bulk.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 |
+
|
toolbench/toolenv/tools/Social/instagram_statistical_analysis.json
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name": "Instagram Statistical analysis",
|
| 3 |
+
"tool_description": "It gives you following things: 1)Lost Followers of your Instagram account 2)New followers of your Instagram account 3)Rank of your posts based on likes rate and comments rate. (If you get error \"Stats not found please Update\" .That means firstly you have to send post request.There are total 3 Post type requests for this API.Followers,Posts,Stories.After this Post Request All other Get requests will work)",
|
| 4 |
+
"title": "Instagram Statistical analysis",
|
| 5 |
+
"pricing": "FREE",
|
| 6 |
+
"score": {
|
| 7 |
+
"avgServiceLevel": 0,
|
| 8 |
+
"avgLatency": 523,
|
| 9 |
+
"avgSuccessRate": 0,
|
| 10 |
+
"popularityScore": 0,
|
| 11 |
+
"__typename": "Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url": "https://rapidapi.com/pradyumnacharate/api/instagram-statistical-analysis/",
|
| 14 |
+
"host": "instagram-statistical-analysis.p.rapidapi.com",
|
| 15 |
+
"api_list": [
|
| 16 |
+
{
|
| 17 |
+
"name": "Instagram Post Statistics",
|
| 18 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/posts",
|
| 19 |
+
"description": "This is required request if you want to know statistics of your posts like \nRank of your posts on basis of likes and comments.\n(Kindly pass the token you get after logging in or registering to this request as Authorization header)\n1.Firstly make this request and then proceed with other get requests for posts statistics and then you will get statistics.",
|
| 20 |
+
"method": "POST",
|
| 21 |
+
"required_parameters": [
|
| 22 |
+
{
|
| 23 |
+
"name": "Authorization",
|
| 24 |
+
"type": "STRING",
|
| 25 |
+
"description": "",
|
| 26 |
+
"default": ""
|
| 27 |
+
}
|
| 28 |
+
],
|
| 29 |
+
"optional_parameters": [],
|
| 30 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/posts\"\nquerystring = {\"Authorization\": authorization}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n}\n\nresponse = requests.post(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 31 |
+
"statuscode": 111,
|
| 32 |
+
"body": "",
|
| 33 |
+
"headers": "",
|
| 34 |
+
"schema": ""
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"name": "Stories Statistics",
|
| 38 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/stories",
|
| 39 |
+
"description": "After you make post request to stories route,Call this request to get all info about your stories.\nIf get requests say \"Stats not found please update\".then Please make above post request to this api first.",
|
| 40 |
+
"method": "GET",
|
| 41 |
+
"required_parameters": [
|
| 42 |
+
{
|
| 43 |
+
"name": "Authorization",
|
| 44 |
+
"type": "STRING",
|
| 45 |
+
"description": "",
|
| 46 |
+
"default": ""
|
| 47 |
+
}
|
| 48 |
+
],
|
| 49 |
+
"optional_parameters": [],
|
| 50 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/stories\"\nquerystring = {\"Authorization\": authorization}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 51 |
+
"statuscode": 111,
|
| 52 |
+
"body": "",
|
| 53 |
+
"headers": "",
|
| 54 |
+
"schema": ""
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"name": "Followers that you don't follow back",
|
| 58 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/followers/infb",
|
| 59 |
+
"description": "Return list of your followers to whom you do not follow back.\nIf get requests say \"Stats not found please update\".then Please make post request first.",
|
| 60 |
+
"method": "GET",
|
| 61 |
+
"required_parameters": [],
|
| 62 |
+
"optional_parameters": [
|
| 63 |
+
{
|
| 64 |
+
"name": "Authorization",
|
| 65 |
+
"type": "STRING",
|
| 66 |
+
"description": "",
|
| 67 |
+
"default": ""
|
| 68 |
+
}
|
| 69 |
+
],
|
| 70 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/followers/infb\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 71 |
+
"statuscode": 111,
|
| 72 |
+
"body": "",
|
| 73 |
+
"headers": "",
|
| 74 |
+
"schema": ""
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"name": "Count of Increased and decreased followers.",
|
| 78 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/followers/statistics",
|
| 79 |
+
"description": "Will return how many followers and followings are decreased and increased.",
|
| 80 |
+
"method": "GET",
|
| 81 |
+
"required_parameters": [],
|
| 82 |
+
"optional_parameters": [
|
| 83 |
+
{
|
| 84 |
+
"name": "Authorization",
|
| 85 |
+
"type": "STRING",
|
| 86 |
+
"description": "",
|
| 87 |
+
"default": ""
|
| 88 |
+
}
|
| 89 |
+
],
|
| 90 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/followers/statistics\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 91 |
+
"statuscode": 111,
|
| 92 |
+
"body": "",
|
| 93 |
+
"headers": "",
|
| 94 |
+
"schema": ""
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"name": "Followings that don't follow you back.",
|
| 98 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/followers/nfb",
|
| 99 |
+
"description": "Will Return list of people who do not follow you back but you follow them.",
|
| 100 |
+
"method": "GET",
|
| 101 |
+
"required_parameters": [
|
| 102 |
+
{
|
| 103 |
+
"name": "Authorization",
|
| 104 |
+
"type": "STRING",
|
| 105 |
+
"description": "",
|
| 106 |
+
"default": ""
|
| 107 |
+
}
|
| 108 |
+
],
|
| 109 |
+
"optional_parameters": [],
|
| 110 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/followers/nfb\"\nquerystring = {\"Authorization\": authorization}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 111 |
+
"statuscode": 111,
|
| 112 |
+
"body": "",
|
| 113 |
+
"headers": "",
|
| 114 |
+
"schema": ""
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"name": "New Followers",
|
| 118 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/followers/new",
|
| 119 |
+
"description": "Returns Followers who started following you.\nIf get requests say \"Stats not found please update\".then Please make post request first.",
|
| 120 |
+
"method": "GET",
|
| 121 |
+
"required_parameters": [
|
| 122 |
+
{
|
| 123 |
+
"name": "Authorization",
|
| 124 |
+
"type": "STRING",
|
| 125 |
+
"description": "",
|
| 126 |
+
"default": ""
|
| 127 |
+
}
|
| 128 |
+
],
|
| 129 |
+
"optional_parameters": [],
|
| 130 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/followers/new\"\nquerystring = {\"Authorization\": authorization}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 131 |
+
"statuscode": 111,
|
| 132 |
+
"body": "",
|
| 133 |
+
"headers": "",
|
| 134 |
+
"schema": ""
|
| 135 |
+
},
|
| 136 |
+
{
|
| 137 |
+
"name": "Lost Followers",
|
| 138 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/followers/lost",
|
| 139 |
+
"description": "Returns people who stopped following you.\nIf get requests say \"Stats not found please update\".then Please make post request first.",
|
| 140 |
+
"method": "GET",
|
| 141 |
+
"required_parameters": [
|
| 142 |
+
{
|
| 143 |
+
"name": "Authorization",
|
| 144 |
+
"type": "STRING",
|
| 145 |
+
"description": "",
|
| 146 |
+
"default": ""
|
| 147 |
+
}
|
| 148 |
+
],
|
| 149 |
+
"optional_parameters": [],
|
| 150 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/followers/lost\"\nquerystring = {\"Authorization\": authorization}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 151 |
+
"statuscode": 111,
|
| 152 |
+
"body": "",
|
| 153 |
+
"headers": "",
|
| 154 |
+
"schema": ""
|
| 155 |
+
},
|
| 156 |
+
{
|
| 157 |
+
"name": "Post Followers and followings",
|
| 158 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/followers",
|
| 159 |
+
"description": "This is compulsory request if you want to get followers and followings of your account.Needs to send at least one request if you want daily statistics.",
|
| 160 |
+
"method": "POST",
|
| 161 |
+
"required_parameters": [
|
| 162 |
+
{
|
| 163 |
+
"name": "Authorization",
|
| 164 |
+
"type": "STRING",
|
| 165 |
+
"description": "",
|
| 166 |
+
"default": ""
|
| 167 |
+
}
|
| 168 |
+
],
|
| 169 |
+
"optional_parameters": [],
|
| 170 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/followers\"\nquerystring = {\"Authorization\": authorization}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n}\n\nresponse = requests.post(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 171 |
+
"statuscode": 111,
|
| 172 |
+
"body": "",
|
| 173 |
+
"headers": "",
|
| 174 |
+
"schema": ""
|
| 175 |
+
},
|
| 176 |
+
{
|
| 177 |
+
"name": "Popularity Statistics of Posts",
|
| 178 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/posts/popular",
|
| 179 |
+
"description": "Will return Posts based on Popularity of posts.",
|
| 180 |
+
"method": "GET",
|
| 181 |
+
"required_parameters": [
|
| 182 |
+
{
|
| 183 |
+
"name": "Authorization",
|
| 184 |
+
"type": "STRING",
|
| 185 |
+
"description": "",
|
| 186 |
+
"default": ""
|
| 187 |
+
}
|
| 188 |
+
],
|
| 189 |
+
"optional_parameters": [],
|
| 190 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/posts/popular\"\nquerystring = {\"Authorization\": authorization}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 191 |
+
"statuscode": 111,
|
| 192 |
+
"body": "",
|
| 193 |
+
"headers": "",
|
| 194 |
+
"schema": ""
|
| 195 |
+
},
|
| 196 |
+
{
|
| 197 |
+
"name": "Get Rankings of Posts based on Comments",
|
| 198 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/posts/ranked/comments",
|
| 199 |
+
"description": "Ranking of Instagram Posts based on Comments.",
|
| 200 |
+
"method": "GET",
|
| 201 |
+
"required_parameters": [
|
| 202 |
+
{
|
| 203 |
+
"name": "Authorization",
|
| 204 |
+
"type": "STRING",
|
| 205 |
+
"description": "",
|
| 206 |
+
"default": ""
|
| 207 |
+
}
|
| 208 |
+
],
|
| 209 |
+
"optional_parameters": [],
|
| 210 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/posts/ranked/comments\"\nquerystring = {\"Authorization\": authorization}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 211 |
+
"statuscode": 111,
|
| 212 |
+
"body": "",
|
| 213 |
+
"headers": "",
|
| 214 |
+
"schema": ""
|
| 215 |
+
},
|
| 216 |
+
{
|
| 217 |
+
"name": "Get Rankings of posts based on likes",
|
| 218 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/posts/ranked/likes",
|
| 219 |
+
"description": "Get likes.",
|
| 220 |
+
"method": "GET",
|
| 221 |
+
"required_parameters": [
|
| 222 |
+
{
|
| 223 |
+
"name": "Authorization",
|
| 224 |
+
"type": "STRING",
|
| 225 |
+
"description": "",
|
| 226 |
+
"default": ""
|
| 227 |
+
}
|
| 228 |
+
],
|
| 229 |
+
"optional_parameters": [],
|
| 230 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/posts/ranked/likes\"\nquerystring = {\"Authorization\": authorization}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 231 |
+
"statuscode": 111,
|
| 232 |
+
"body": "",
|
| 233 |
+
"headers": "",
|
| 234 |
+
"schema": ""
|
| 235 |
+
},
|
| 236 |
+
{
|
| 237 |
+
"name": "Stories Statistics",
|
| 238 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/stories",
|
| 239 |
+
"description": "Don't pass anything to key1 and key2.",
|
| 240 |
+
"method": "POST",
|
| 241 |
+
"required_parameters": [
|
| 242 |
+
{
|
| 243 |
+
"name": "Authorization",
|
| 244 |
+
"type": "STRING",
|
| 245 |
+
"description": "",
|
| 246 |
+
"default": ""
|
| 247 |
+
}
|
| 248 |
+
],
|
| 249 |
+
"optional_parameters": [],
|
| 250 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/stories\"\nquerystring = {\"Authorization\": authorization}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n}\n\nresponse = requests.post(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 251 |
+
"statuscode": 111,
|
| 252 |
+
"body": "",
|
| 253 |
+
"headers": "",
|
| 254 |
+
"schema": ""
|
| 255 |
+
},
|
| 256 |
+
{
|
| 257 |
+
"name": "Instagram Post Statistics",
|
| 258 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/posts",
|
| 259 |
+
"description": "This is required request if you want to know statistics of your posts like \nRank of your posts on basis of likes and comments.\n(Kindly pass the token you get after logging in or registering to this request as Authorization header)\n1.Firstly make this request and then proceed with other get requests for posts statistics and then you will get statistics.",
|
| 260 |
+
"method": "POST",
|
| 261 |
+
"required_parameters": [],
|
| 262 |
+
"optional_parameters": [],
|
| 263 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/posts\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 264 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/posts\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 265 |
+
"test_endpoint": ""
|
| 266 |
+
},
|
| 267 |
+
{
|
| 268 |
+
"name": "Post Followers and followings",
|
| 269 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/followers",
|
| 270 |
+
"description": "This is compulsory request if you want to get followers and followings of your account.Needs to send at least one request if you want daily statistics.",
|
| 271 |
+
"method": "POST",
|
| 272 |
+
"required_parameters": [],
|
| 273 |
+
"optional_parameters": [],
|
| 274 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/followers\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 275 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/followers\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 276 |
+
"test_endpoint": ""
|
| 277 |
+
},
|
| 278 |
+
{
|
| 279 |
+
"name": "Stories Statistics",
|
| 280 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/stories",
|
| 281 |
+
"description": "Don't pass anything to key1 and key2.",
|
| 282 |
+
"method": "POST",
|
| 283 |
+
"required_parameters": [],
|
| 284 |
+
"optional_parameters": [],
|
| 285 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/stories\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 286 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/stories\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 287 |
+
"test_endpoint": ""
|
| 288 |
+
},
|
| 289 |
+
{
|
| 290 |
+
"name": "Register Free for Our Apis",
|
| 291 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/signup",
|
| 292 |
+
"description": "This is one time process and only require two fields.\n1.Instagram Username(Account's Username which you want to scrape)\n2.Any password(Don't have to be Instagram password)\n\n*Use this token you get in next requests",
|
| 293 |
+
"method": "POST",
|
| 294 |
+
"required_parameters": [],
|
| 295 |
+
"optional_parameters": [],
|
| 296 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/signup\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 297 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/signup\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 298 |
+
"test_endpoint": "",
|
| 299 |
+
"statuscode": 1,
|
| 300 |
+
"schema": ""
|
| 301 |
+
},
|
| 302 |
+
{
|
| 303 |
+
"name": "Login Route",
|
| 304 |
+
"url": "https://instagram-statistical-analysis.p.rapidapi.com/api/login",
|
| 305 |
+
"description": "You can login using this api and get authorization token required for other api requests.\n1.username and password should be same as when you registered for our app.",
|
| 306 |
+
"method": "POST",
|
| 307 |
+
"required_parameters": [],
|
| 308 |
+
"optional_parameters": [],
|
| 309 |
+
"code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/login\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 310 |
+
"convert_code": "import requests\n\nurl = \"https://instagram-statistical-analysis.p.rapidapi.com/api/login\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-statistical-analysis.p.rapidapi.com\"\n }\n\nresponse = requests.post(url, headers=headers)\nprint(response.json())\n",
|
| 311 |
+
"test_endpoint": "",
|
| 312 |
+
"statuscode": 1,
|
| 313 |
+
"schema": ""
|
| 314 |
+
}
|
| 315 |
+
]
|
| 316 |
+
}
|
toolbench/toolenv/tools/Social/instagram_statistical_analysis/api.py
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 stories_statistics(authorization: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"After you make post request to stories route,Call this request to get all info about your stories.
|
| 12 |
+
If get requests say "Stats not found please update".then Please make above post request to this api first."
|
| 13 |
+
|
| 14 |
+
"""
|
| 15 |
+
url = f"https://instagram-statistical-analysis.p.rapidapi.com/api/stories"
|
| 16 |
+
querystring = {'Authorization': authorization, }
|
| 17 |
+
|
| 18 |
+
headers = {
|
| 19 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 20 |
+
"X-RapidAPI-Host": "instagram-statistical-analysis.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 followers_that_you_don_t_follow_back(authorization: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 32 |
+
"""
|
| 33 |
+
"Return list of your followers to whom you do not follow back.
|
| 34 |
+
If get requests say "Stats not found please update".then Please make post request first."
|
| 35 |
+
|
| 36 |
+
"""
|
| 37 |
+
url = f"https://instagram-statistical-analysis.p.rapidapi.com/api/followers/infb"
|
| 38 |
+
querystring = {}
|
| 39 |
+
if authorization:
|
| 40 |
+
querystring['Authorization'] = authorization
|
| 41 |
+
|
| 42 |
+
headers = {
|
| 43 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 44 |
+
"X-RapidAPI-Host": "instagram-statistical-analysis.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 count_of_increased_and_decreased_followers(authorization: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 56 |
+
"""
|
| 57 |
+
"Will return how many followers and followings are decreased and increased."
|
| 58 |
+
|
| 59 |
+
"""
|
| 60 |
+
url = f"https://instagram-statistical-analysis.p.rapidapi.com/api/followers/statistics"
|
| 61 |
+
querystring = {}
|
| 62 |
+
if authorization:
|
| 63 |
+
querystring['Authorization'] = authorization
|
| 64 |
+
|
| 65 |
+
headers = {
|
| 66 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 67 |
+
"X-RapidAPI-Host": "instagram-statistical-analysis.p.rapidapi.com"
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 72 |
+
try:
|
| 73 |
+
observation = response.json()
|
| 74 |
+
except:
|
| 75 |
+
observation = response.text
|
| 76 |
+
return observation
|
| 77 |
+
|
| 78 |
+
def followings_that_don_t_follow_you_back(authorization: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 79 |
+
"""
|
| 80 |
+
"Will Return list of people who do not follow you back but you follow them."
|
| 81 |
+
|
| 82 |
+
"""
|
| 83 |
+
url = f"https://instagram-statistical-analysis.p.rapidapi.com/api/followers/nfb"
|
| 84 |
+
querystring = {'Authorization': authorization, }
|
| 85 |
+
|
| 86 |
+
headers = {
|
| 87 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 88 |
+
"X-RapidAPI-Host": "instagram-statistical-analysis.p.rapidapi.com"
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 93 |
+
try:
|
| 94 |
+
observation = response.json()
|
| 95 |
+
except:
|
| 96 |
+
observation = response.text
|
| 97 |
+
return observation
|
| 98 |
+
|
| 99 |
+
def new_followers(authorization: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 100 |
+
"""
|
| 101 |
+
"Returns Followers who started following you.
|
| 102 |
+
If get requests say "Stats not found please update".then Please make post request first."
|
| 103 |
+
|
| 104 |
+
"""
|
| 105 |
+
url = f"https://instagram-statistical-analysis.p.rapidapi.com/api/followers/new"
|
| 106 |
+
querystring = {'Authorization': authorization, }
|
| 107 |
+
|
| 108 |
+
headers = {
|
| 109 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 110 |
+
"X-RapidAPI-Host": "instagram-statistical-analysis.p.rapidapi.com"
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 115 |
+
try:
|
| 116 |
+
observation = response.json()
|
| 117 |
+
except:
|
| 118 |
+
observation = response.text
|
| 119 |
+
return observation
|
| 120 |
+
|
| 121 |
+
def lost_followers(authorization: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 122 |
+
"""
|
| 123 |
+
"Returns people who stopped following you.
|
| 124 |
+
If get requests say "Stats not found please update".then Please make post request first."
|
| 125 |
+
|
| 126 |
+
"""
|
| 127 |
+
url = f"https://instagram-statistical-analysis.p.rapidapi.com/api/followers/lost"
|
| 128 |
+
querystring = {'Authorization': authorization, }
|
| 129 |
+
|
| 130 |
+
headers = {
|
| 131 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 132 |
+
"X-RapidAPI-Host": "instagram-statistical-analysis.p.rapidapi.com"
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 137 |
+
try:
|
| 138 |
+
observation = response.json()
|
| 139 |
+
except:
|
| 140 |
+
observation = response.text
|
| 141 |
+
return observation
|
| 142 |
+
|
| 143 |
+
def popularity_statistics_of_posts(authorization: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 144 |
+
"""
|
| 145 |
+
"Will return Posts based on Popularity of posts."
|
| 146 |
+
|
| 147 |
+
"""
|
| 148 |
+
url = f"https://instagram-statistical-analysis.p.rapidapi.com/api/posts/popular"
|
| 149 |
+
querystring = {'Authorization': authorization, }
|
| 150 |
+
|
| 151 |
+
headers = {
|
| 152 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 153 |
+
"X-RapidAPI-Host": "instagram-statistical-analysis.p.rapidapi.com"
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 158 |
+
try:
|
| 159 |
+
observation = response.json()
|
| 160 |
+
except:
|
| 161 |
+
observation = response.text
|
| 162 |
+
return observation
|
| 163 |
+
|
| 164 |
+
def get_rankings_of_posts_based_on_comments(authorization: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 165 |
+
"""
|
| 166 |
+
"Ranking of Instagram Posts based on Comments."
|
| 167 |
+
|
| 168 |
+
"""
|
| 169 |
+
url = f"https://instagram-statistical-analysis.p.rapidapi.com/api/posts/ranked/comments"
|
| 170 |
+
querystring = {'Authorization': authorization, }
|
| 171 |
+
|
| 172 |
+
headers = {
|
| 173 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 174 |
+
"X-RapidAPI-Host": "instagram-statistical-analysis.p.rapidapi.com"
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
|
| 178 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 179 |
+
try:
|
| 180 |
+
observation = response.json()
|
| 181 |
+
except:
|
| 182 |
+
observation = response.text
|
| 183 |
+
return observation
|
| 184 |
+
|
| 185 |
+
def get_rankings_of_posts_based_on_likes(authorization: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 186 |
+
"""
|
| 187 |
+
"Get likes."
|
| 188 |
+
|
| 189 |
+
"""
|
| 190 |
+
url = f"https://instagram-statistical-analysis.p.rapidapi.com/api/posts/ranked/likes"
|
| 191 |
+
querystring = {'Authorization': authorization, }
|
| 192 |
+
|
| 193 |
+
headers = {
|
| 194 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 195 |
+
"X-RapidAPI-Host": "instagram-statistical-analysis.p.rapidapi.com"
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
|
| 199 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 200 |
+
try:
|
| 201 |
+
observation = response.json()
|
| 202 |
+
except:
|
| 203 |
+
observation = response.text
|
| 204 |
+
return observation
|
| 205 |
+
|
toolbench/toolenv/tools/Social/instagram_statistics_api.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
toolbench/toolenv/tools/Social/instagram_statistics_api/api.py
ADDED
|
@@ -0,0 +1,299 @@
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 feed(to: str, is_from: str, cid: str, force: bool=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Returns a list of posts with all metrics for the period.
|
| 12 |
+
|
| 13 |
+
The effectiveness of hashtags, post types and text length
|
| 14 |
+
|
| 15 |
+
"
|
| 16 |
+
force: true - for priority data analysis and frequent statistics updates
|
| 17 |
+
|
| 18 |
+
"""
|
| 19 |
+
url = f"https://instagram-statistics-api.p.rapidapi.com/posts"
|
| 20 |
+
querystring = {'to': to, 'from': is_from, 'cid': cid, }
|
| 21 |
+
if force:
|
| 22 |
+
querystring['force'] = force
|
| 23 |
+
|
| 24 |
+
headers = {
|
| 25 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 26 |
+
"X-RapidAPI-Host": "instagram-statistics-api.p.rapidapi.com"
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 31 |
+
try:
|
| 32 |
+
observation = response.json()
|
| 33 |
+
except:
|
| 34 |
+
observation = response.text
|
| 35 |
+
return observation
|
| 36 |
+
|
| 37 |
+
def profile_by_url(url: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 38 |
+
"""
|
| 39 |
+
"Get full profile information with statistics and audience demographics.
|
| 40 |
+
Category/Interests, Gender, Age, Location, Followers, Engagement Rate, Fake Followers, Contact email, Quality Score, Verified, Average Interactions, Average Likes, Average Comments, Average Reels Views, Average Reels Likes, Average Reels Comments, Audience genders, Audience Ages, Audience Locations, Lasts Posts, Last Mentions, ...
|
| 41 |
+
|
| 42 |
+
"
|
| 43 |
+
|
| 44 |
+
"""
|
| 45 |
+
url = f"https://instagram-statistics-api.p.rapidapi.com/community"
|
| 46 |
+
querystring = {'url': url, }
|
| 47 |
+
|
| 48 |
+
headers = {
|
| 49 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 50 |
+
"X-RapidAPI-Host": "instagram-statistics-api.p.rapidapi.com"
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 55 |
+
try:
|
| 56 |
+
observation = response.json()
|
| 57 |
+
except:
|
| 58 |
+
observation = response.text
|
| 59 |
+
return observation
|
| 60 |
+
|
| 61 |
+
def search(perpage: int, iscontactemail: bool=None, isverified: bool=None, minaudiencegenderspercent: str=None, minaudienceagepercent: str=None, minaudiencelocationspercent: str=None, maxinteractions: str=None, mininteractions: str=None, tracktotal: bool=None, minfakefollowers: str=None, maxvideoviews: str=None, minqualityscore: str=None, maxqualityscore: str=None, maxvideocomments: str=None, maxfakefollowers: str=None, maxvideolikes: str=None, minvideolikes: str=None, minvideoviews: str=None, minvideocomments: str=None, maxcomments: str=None, minlikes: str=None, maxlikes: str=None, minaudienceage: str=None, mincomments: str=None, maxaudienceage: str=None, audiencelocations: str=None, audienceages: str=None, maxuserscount: str=None, ages: str=None, genders: str=None, locations: str='united-states', q: str=None, sort: str='-score', tags: str=None, maxviews: str=None, audiencegenders: str=None, socialtypes: str='INST,FB', miner: str=None, minage: str=None, maxage: str=None, minviews: str=None, minuserscount: str=None, maxer: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 62 |
+
"""
|
| 63 |
+
"Search in the database of brands and influencers by parameters:
|
| 64 |
+
- Keywords in the title, description, account link
|
| 65 |
+
- Filtering by categories, account types, interests and other tags
|
| 66 |
+
- Demographics of subscribers (country, city, gender, age)
|
| 67 |
+
- Social network
|
| 68 |
+
- Number of subscribers
|
| 69 |
+
- Average Engagement per post
|
| 70 |
+
- Average number of post views
|
| 71 |
+
- Sort by relevance, percentage of selected audience or number of selected audience"
|
| 72 |
+
ages: Account age (for influencer)
|
| 73 |
+
0_18
|
| 74 |
+
18_21
|
| 75 |
+
21_24
|
| 76 |
+
24_27
|
| 77 |
+
27_30
|
| 78 |
+
30_35
|
| 79 |
+
35_45
|
| 80 |
+
45_100
|
| 81 |
+
genders: Account gender (for influencer)
|
| 82 |
+
m - Male
|
| 83 |
+
f - Female
|
| 84 |
+
locations: Account location (country or city)
|
| 85 |
+
from Tags
|
| 86 |
+
sort: -score - by Relevance
|
| 87 |
+
-usersCount - by Followers
|
| 88 |
+
-avgViews - by Views
|
| 89 |
+
-avgER - by Engagement Rate
|
| 90 |
+
-qualityScore - by Quality Score
|
| 91 |
+
tags: from Tags
|
| 92 |
+
socialtypes: INST - Instagram
|
| 93 |
+
FB - Facebook
|
| 94 |
+
TW - Twitter
|
| 95 |
+
YT - YouTube
|
| 96 |
+
TT - TikTok
|
| 97 |
+
TG - Telegram
|
| 98 |
+
|
| 99 |
+
"""
|
| 100 |
+
url = f"https://instagram-statistics-api.p.rapidapi.com/search"
|
| 101 |
+
querystring = {'perPage': perpage, }
|
| 102 |
+
if iscontactemail:
|
| 103 |
+
querystring['isContactEmail'] = iscontactemail
|
| 104 |
+
if isverified:
|
| 105 |
+
querystring['isVerified'] = isverified
|
| 106 |
+
if minaudiencegenderspercent:
|
| 107 |
+
querystring['minAudienceGendersPercent'] = minaudiencegenderspercent
|
| 108 |
+
if minaudienceagepercent:
|
| 109 |
+
querystring['minAudienceAgePercent'] = minaudienceagepercent
|
| 110 |
+
if minaudiencelocationspercent:
|
| 111 |
+
querystring['minAudienceLocationsPercent'] = minaudiencelocationspercent
|
| 112 |
+
if maxinteractions:
|
| 113 |
+
querystring['maxInteractions'] = maxinteractions
|
| 114 |
+
if mininteractions:
|
| 115 |
+
querystring['minInteractions'] = mininteractions
|
| 116 |
+
if tracktotal:
|
| 117 |
+
querystring['trackTotal'] = tracktotal
|
| 118 |
+
if minfakefollowers:
|
| 119 |
+
querystring['minFakeFollowers'] = minfakefollowers
|
| 120 |
+
if maxvideoviews:
|
| 121 |
+
querystring['maxVideoViews'] = maxvideoviews
|
| 122 |
+
if minqualityscore:
|
| 123 |
+
querystring['minQualityScore'] = minqualityscore
|
| 124 |
+
if maxqualityscore:
|
| 125 |
+
querystring['maxQualityScore'] = maxqualityscore
|
| 126 |
+
if maxvideocomments:
|
| 127 |
+
querystring['maxVideoComments'] = maxvideocomments
|
| 128 |
+
if maxfakefollowers:
|
| 129 |
+
querystring['maxFakeFollowers'] = maxfakefollowers
|
| 130 |
+
if maxvideolikes:
|
| 131 |
+
querystring['maxVideoLikes'] = maxvideolikes
|
| 132 |
+
if minvideolikes:
|
| 133 |
+
querystring['minVideoLikes'] = minvideolikes
|
| 134 |
+
if minvideoviews:
|
| 135 |
+
querystring['minVideoViews'] = minvideoviews
|
| 136 |
+
if minvideocomments:
|
| 137 |
+
querystring['minVideoComments'] = minvideocomments
|
| 138 |
+
if maxcomments:
|
| 139 |
+
querystring['maxComments'] = maxcomments
|
| 140 |
+
if minlikes:
|
| 141 |
+
querystring['minLikes'] = minlikes
|
| 142 |
+
if maxlikes:
|
| 143 |
+
querystring['maxLikes'] = maxlikes
|
| 144 |
+
if minaudienceage:
|
| 145 |
+
querystring['minAudienceAge'] = minaudienceage
|
| 146 |
+
if mincomments:
|
| 147 |
+
querystring['minComments'] = mincomments
|
| 148 |
+
if maxaudienceage:
|
| 149 |
+
querystring['maxAudienceAge'] = maxaudienceage
|
| 150 |
+
if audiencelocations:
|
| 151 |
+
querystring['audienceLocations'] = audiencelocations
|
| 152 |
+
if audienceages:
|
| 153 |
+
querystring['audienceAges'] = audienceages
|
| 154 |
+
if maxuserscount:
|
| 155 |
+
querystring['maxUsersCount'] = maxuserscount
|
| 156 |
+
if ages:
|
| 157 |
+
querystring['ages'] = ages
|
| 158 |
+
if genders:
|
| 159 |
+
querystring['genders'] = genders
|
| 160 |
+
if locations:
|
| 161 |
+
querystring['locations'] = locations
|
| 162 |
+
if q:
|
| 163 |
+
querystring['q'] = q
|
| 164 |
+
if sort:
|
| 165 |
+
querystring['sort'] = sort
|
| 166 |
+
if tags:
|
| 167 |
+
querystring['tags'] = tags
|
| 168 |
+
if maxviews:
|
| 169 |
+
querystring['maxViews'] = maxviews
|
| 170 |
+
if audiencegenders:
|
| 171 |
+
querystring['audienceGenders'] = audiencegenders
|
| 172 |
+
if socialtypes:
|
| 173 |
+
querystring['socialTypes'] = socialtypes
|
| 174 |
+
if miner:
|
| 175 |
+
querystring['minER'] = miner
|
| 176 |
+
if minage:
|
| 177 |
+
querystring['minAge'] = minage
|
| 178 |
+
if maxage:
|
| 179 |
+
querystring['maxAge'] = maxage
|
| 180 |
+
if minviews:
|
| 181 |
+
querystring['minViews'] = minviews
|
| 182 |
+
if minuserscount:
|
| 183 |
+
querystring['minUsersCount'] = minuserscount
|
| 184 |
+
if maxer:
|
| 185 |
+
querystring['maxER'] = maxer
|
| 186 |
+
|
| 187 |
+
headers = {
|
| 188 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 189 |
+
"X-RapidAPI-Host": "instagram-statistics-api.p.rapidapi.com"
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
|
| 193 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 194 |
+
try:
|
| 195 |
+
observation = response.json()
|
| 196 |
+
except:
|
| 197 |
+
observation = response.text
|
| 198 |
+
return observation
|
| 199 |
+
|
| 200 |
+
def profile_by_id(cid: str, force: bool=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 201 |
+
"""
|
| 202 |
+
"Get full profile information with statistics and audience demographics.
|
| 203 |
+
Category/Interests, Gender, Age, Location, Followers, Engagement Rate, Fake Followers, Contact email, Quality Score, Verified, Average Interactions, Average Likes, Average Comments, Average Reels Views, Average Reels Likes, Average Reels Comments, Audience genders, Audience Ages, Audience Locations, Lasts Posts, Last Mentions, ...
|
| 204 |
+
|
| 205 |
+
"
|
| 206 |
+
force: true - for priority data analysis and frequent statistics updates
|
| 207 |
+
|
| 208 |
+
"""
|
| 209 |
+
url = f"https://instagram-statistics-api.p.rapidapi.com/community"
|
| 210 |
+
querystring = {'cid': cid, }
|
| 211 |
+
if force:
|
| 212 |
+
querystring['force'] = force
|
| 213 |
+
|
| 214 |
+
headers = {
|
| 215 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 216 |
+
"X-RapidAPI-Host": "instagram-statistics-api.p.rapidapi.com"
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
|
| 220 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 221 |
+
try:
|
| 222 |
+
observation = response.json()
|
| 223 |
+
except:
|
| 224 |
+
observation = response.text
|
| 225 |
+
return observation
|
| 226 |
+
|
| 227 |
+
def activity(cid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 228 |
+
"""
|
| 229 |
+
"Returns data for plotting the activity time graph of account users. Helps to understand when it is better to publish content and make integrations with influencers
|
| 230 |
+
|
| 231 |
+
"
|
| 232 |
+
|
| 233 |
+
"""
|
| 234 |
+
url = f"https://instagram-statistics-api.p.rapidapi.com/statistics/activity"
|
| 235 |
+
querystring = {'cid': cid, }
|
| 236 |
+
|
| 237 |
+
headers = {
|
| 238 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 239 |
+
"X-RapidAPI-Host": "instagram-statistics-api.p.rapidapi.com"
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
|
| 243 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 244 |
+
try:
|
| 245 |
+
observation = response.json()
|
| 246 |
+
except:
|
| 247 |
+
observation = response.text
|
| 248 |
+
return observation
|
| 249 |
+
|
| 250 |
+
def retrospective(to: str, is_from: str, cid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 251 |
+
"""
|
| 252 |
+
"Returns the history of the number of subscribers, posts, interactions, likes, comments, reposts, engagement for the selected period by day and in total for the period
|
| 253 |
+
|
| 254 |
+
"
|
| 255 |
+
|
| 256 |
+
"""
|
| 257 |
+
url = f"https://instagram-statistics-api.p.rapidapi.com/statistics/retrospective"
|
| 258 |
+
querystring = {'to': to, 'from': is_from, 'cid': cid, }
|
| 259 |
+
|
| 260 |
+
headers = {
|
| 261 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 262 |
+
"X-RapidAPI-Host": "instagram-statistics-api.p.rapidapi.com"
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
|
| 266 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 267 |
+
try:
|
| 268 |
+
observation = response.json()
|
| 269 |
+
except:
|
| 270 |
+
observation = response.text
|
| 271 |
+
return observation
|
| 272 |
+
|
| 273 |
+
def tags(limit: str, type: str, q: str=None, parent: str='turkey', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 274 |
+
"""
|
| 275 |
+
"Returns all tags with which accounts are marked.
|
| 276 |
+
You can filter the desired tags and nesting."
|
| 277 |
+
type: country, city, category, type, interest
|
| 278 |
+
|
| 279 |
+
"""
|
| 280 |
+
url = f"https://instagram-statistics-api.p.rapidapi.com/rating/tags"
|
| 281 |
+
querystring = {'limit': limit, 'type': type, }
|
| 282 |
+
if q:
|
| 283 |
+
querystring['q'] = q
|
| 284 |
+
if parent:
|
| 285 |
+
querystring['parent'] = parent
|
| 286 |
+
|
| 287 |
+
headers = {
|
| 288 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 289 |
+
"X-RapidAPI-Host": "instagram-statistics-api.p.rapidapi.com"
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
|
| 293 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 294 |
+
try:
|
| 295 |
+
observation = response.json()
|
| 296 |
+
except:
|
| 297 |
+
observation = response.text
|
| 298 |
+
return observation
|
| 299 |
+
|
toolbench/toolenv/tools/Social/instagram_story_and_highlights_saver.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name":"Instagram Story and Highlights Saver",
|
| 3 |
+
"tool_description":"Download Instagram Stories or Story Highlights.",
|
| 4 |
+
"title":"Instagram Story and Highlights Saver",
|
| 5 |
+
"pricing":"FREEMIUM",
|
| 6 |
+
"score":{
|
| 7 |
+
"avgServiceLevel":100,
|
| 8 |
+
"avgLatency":1569,
|
| 9 |
+
"avgSuccessRate":100,
|
| 10 |
+
"popularityScore":9.7,
|
| 11 |
+
"__typename":"Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url":"https://rapidapi.com/vahota/api/instagram-story-and-highlights-saver/",
|
| 14 |
+
"host":"instagram-story-and-highlights-saver.p.rapidapi.com",
|
| 15 |
+
"api_list":[
|
| 16 |
+
{
|
| 17 |
+
"name":"/api/stories",
|
| 18 |
+
"url":"https://instagram-story-and-highlights-saver.p.rapidapi.com/api/stories",
|
| 19 |
+
"description":"Get full profile info, stories, and highlights.",
|
| 20 |
+
"method":"GET",
|
| 21 |
+
"required_parameters":[
|
| 22 |
+
{
|
| 23 |
+
"name":"username",
|
| 24 |
+
"type":"STRING",
|
| 25 |
+
"description":"Enter IG username (start from @)",
|
| 26 |
+
"default":"@jlo"
|
| 27 |
+
}
|
| 28 |
+
],
|
| 29 |
+
"optional_parameters":[],
|
| 30 |
+
"code":"import requests\n\nurl = \"https://instagram-story-and-highlights-saver.p.rapidapi.com/api/stories\"\nquerystring = {\"username\": username}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-story-and-highlights-saver.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 |
+
"name":"/api",
|
| 38 |
+
"url":"https://instagram-story-and-highlights-saver.p.rapidapi.com/api",
|
| 39 |
+
"description":"Get api version number.",
|
| 40 |
+
"method":"GET",
|
| 41 |
+
"required_parameters":[],
|
| 42 |
+
"optional_parameters":[],
|
| 43 |
+
"code":"import requests\n\nurl = \"https://instagram-story-and-highlights-saver.p.rapidapi.com/api\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-story-and-highlights-saver.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n",
|
| 44 |
+
"statuscode":111,
|
| 45 |
+
"body":"",
|
| 46 |
+
"headers":"",
|
| 47 |
+
"schema":""
|
| 48 |
+
}
|
| 49 |
+
]
|
| 50 |
+
}
|
toolbench/toolenv/tools/Social/instagram_story_and_highlights_saver/api.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 api_stories(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get full profile info, stories, and highlights."
|
| 12 |
+
username: Enter IG username (start from @)
|
| 13 |
+
|
| 14 |
+
"""
|
| 15 |
+
url = f"https://instagram-story-and-highlights-saver.p.rapidapi.com/api/stories"
|
| 16 |
+
querystring = {'username': username, }
|
| 17 |
+
|
| 18 |
+
headers = {
|
| 19 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 20 |
+
"X-RapidAPI-Host": "instagram-story-and-highlights-saver.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 api(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 32 |
+
"""
|
| 33 |
+
"Get api version number."
|
| 34 |
+
|
| 35 |
+
"""
|
| 36 |
+
url = f"https://instagram-story-and-highlights-saver.p.rapidapi.com/api"
|
| 37 |
+
querystring = {}
|
| 38 |
+
|
| 39 |
+
headers = {
|
| 40 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 41 |
+
"X-RapidAPI-Host": "instagram-story-and-highlights-saver.p.rapidapi.com"
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 46 |
+
try:
|
| 47 |
+
observation = response.json()
|
| 48 |
+
except:
|
| 49 |
+
observation = response.text
|
| 50 |
+
return observation
|
| 51 |
+
|
toolbench/toolenv/tools/Social/instagram_story_downloader_media_downloader.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tool_name":"Instagram Story Downloader - Media downloader ",
|
| 3 |
+
"tool_description":"Download Stories by username or link, Download Reels ,IGTV , Profile pictures, and photos!\nDownload any Instagram media type!\n- Stories are supported to be downloaded by username or URL.\n- Smart endpoint to recognize the type of media, one URL for all instead of connecting to a lot of endpoints.\n- NEW - Backup method to avoid any problems!\n- powered by strong servers\n- The lowest latencny time in the market !! \n- affordable plans and high value (The #1 option on the market)",
|
| 4 |
+
"title":"Instagram Story Downloader - Media downloader ",
|
| 5 |
+
"pricing":"FREEMIUM",
|
| 6 |
+
"score":{
|
| 7 |
+
"avgServiceLevel":97,
|
| 8 |
+
"avgLatency":7981,
|
| 9 |
+
"avgSuccessRate":97,
|
| 10 |
+
"popularityScore":9.9,
|
| 11 |
+
"__typename":"Score"
|
| 12 |
+
},
|
| 13 |
+
"home_url":"https://rapidapi.com/maatootz/api/instagram-story-downloader-media-downloader/",
|
| 14 |
+
"host":"instagram-story-downloader-media-downloader.p.rapidapi.com",
|
| 15 |
+
"api_list":[
|
| 16 |
+
{
|
| 17 |
+
"name":"Profile Picture & Profile info[maintenance]",
|
| 18 |
+
"url":"https://instagram-story-downloader-media-downloader.p.rapidapi.com/profile/index",
|
| 19 |
+
"description":"Profile Picture & Profile info\nyou can use it by profile URL or the username\n- followers number and more info will be added soon",
|
| 20 |
+
"method":"GET",
|
| 21 |
+
"required_parameters":[
|
| 22 |
+
{
|
| 23 |
+
"name":"url",
|
| 24 |
+
"type":"STRING",
|
| 25 |
+
"description":"",
|
| 26 |
+
"default":"https://www.instagram.com/therock/"
|
| 27 |
+
}
|
| 28 |
+
],
|
| 29 |
+
"optional_parameters":[],
|
| 30 |
+
"code":"import requests\n\nurl = \"https://instagram-story-downloader-media-downloader.p.rapidapi.com/profile/index\"\nquerystring = {\"url\": url}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-story-downloader-media-downloader.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 |
+
"name":"Stories by Username / URL",
|
| 38 |
+
"url":"https://instagram-story-downloader-media-downloader.p.rapidapi.com/story/index",
|
| 39 |
+
"description":"this endpoint can be used to get all user stories",
|
| 40 |
+
"method":"GET",
|
| 41 |
+
"required_parameters":[
|
| 42 |
+
{
|
| 43 |
+
"name":"url",
|
| 44 |
+
"type":"STRING",
|
| 45 |
+
"description":"",
|
| 46 |
+
"default":"therock"
|
| 47 |
+
}
|
| 48 |
+
],
|
| 49 |
+
"optional_parameters":[],
|
| 50 |
+
"code":"import requests\n\nurl = \"https://instagram-story-downloader-media-downloader.p.rapidapi.com/story/index\"\nquerystring = {\"url\": url}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-story-downloader-media-downloader.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 51 |
+
"statuscode":111,
|
| 52 |
+
"body":"",
|
| 53 |
+
"headers":"",
|
| 54 |
+
"schema":""
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"name":"Posts - Story - Reels - IGTV",
|
| 58 |
+
"url":"https://instagram-story-downloader-media-downloader.p.rapidapi.com/index",
|
| 59 |
+
"description":"All post types with stories and reels are supported \nthis endpoint recognizes the media type!",
|
| 60 |
+
"method":"GET",
|
| 61 |
+
"required_parameters":[
|
| 62 |
+
{
|
| 63 |
+
"name":"url",
|
| 64 |
+
"type":"STRING",
|
| 65 |
+
"description":"",
|
| 66 |
+
"default":"https://www.instagram.com/p/CbXzHzEFv5q/"
|
| 67 |
+
}
|
| 68 |
+
],
|
| 69 |
+
"optional_parameters":[],
|
| 70 |
+
"code":"import requests\n\nurl = \"https://instagram-story-downloader-media-downloader.p.rapidapi.com/index\"\nquerystring = {\"url\": url}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram-story-downloader-media-downloader.p.rapidapi.com\"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n",
|
| 71 |
+
"statuscode":111,
|
| 72 |
+
"body":"",
|
| 73 |
+
"headers":"",
|
| 74 |
+
"schema":""
|
| 75 |
+
}
|
| 76 |
+
]
|
| 77 |
+
}
|
toolbench/toolenv/tools/Social/instagram_story_downloader_media_downloader/api.py
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 profile_picture_profile_info_maintenance(url: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Profile Picture & Profile info
|
| 12 |
+
you can use it by profile URL or the username
|
| 13 |
+
- followers number and more info will be added soon"
|
| 14 |
+
|
| 15 |
+
"""
|
| 16 |
+
url = f"https://instagram-story-downloader-media-downloader.p.rapidapi.com/profile/index"
|
| 17 |
+
querystring = {'url': url, }
|
| 18 |
+
|
| 19 |
+
headers = {
|
| 20 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 21 |
+
"X-RapidAPI-Host": "instagram-story-downloader-media-downloader.p.rapidapi.com"
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 26 |
+
try:
|
| 27 |
+
observation = response.json()
|
| 28 |
+
except:
|
| 29 |
+
observation = response.text
|
| 30 |
+
return observation
|
| 31 |
+
|
| 32 |
+
def stories_by_username_url(url: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 33 |
+
"""
|
| 34 |
+
"this endpoint can be used to get all user stories"
|
| 35 |
+
|
| 36 |
+
"""
|
| 37 |
+
url = f"https://instagram-story-downloader-media-downloader.p.rapidapi.com/story/index"
|
| 38 |
+
querystring = {'url': url, }
|
| 39 |
+
|
| 40 |
+
headers = {
|
| 41 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 42 |
+
"X-RapidAPI-Host": "instagram-story-downloader-media-downloader.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 posts_story_reels_igtv(url: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 54 |
+
"""
|
| 55 |
+
"All post types with stories and reels are supported
|
| 56 |
+
this endpoint recognizes the media type!"
|
| 57 |
+
|
| 58 |
+
"""
|
| 59 |
+
url = f"https://instagram-story-downloader-media-downloader.p.rapidapi.com/index"
|
| 60 |
+
querystring = {'url': url, }
|
| 61 |
+
|
| 62 |
+
headers = {
|
| 63 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 64 |
+
"X-RapidAPI-Host": "instagram-story-downloader-media-downloader.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 |
+
|
toolbench/toolenv/tools/Social/instagram_utils/api.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_profile_info(profile: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get meta information about one Instagram profile."
|
| 12 |
+
profile: Instagram profile username
|
| 13 |
+
|
| 14 |
+
"""
|
| 15 |
+
url = f"https://instagram-utils.p.rapidapi.com/v1/profile_info"
|
| 16 |
+
querystring = {'profile': profile, }
|
| 17 |
+
|
| 18 |
+
headers = {
|
| 19 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 20 |
+
"X-RapidAPI-Host": "instagram-utils.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_media_info(url: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 32 |
+
"""
|
| 33 |
+
"Get meta information about one Instagram post, by url"
|
| 34 |
+
url: Instagram post Url
|
| 35 |
+
|
| 36 |
+
"""
|
| 37 |
+
url = f"https://instagram-utils.p.rapidapi.com/v1/media_info"
|
| 38 |
+
querystring = {'url': url, }
|
| 39 |
+
|
| 40 |
+
headers = {
|
| 41 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 42 |
+
"X-RapidAPI-Host": "instagram-utils.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 |
+
|
toolbench/toolenv/tools/Social/instagram_v10.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_6217e559-eebd-4a65-9953-8e8e42eba3df",
|
| 3 |
+
"tool_description": "Please join our telegram channel to get notified about updates. https://t.me/social_miner_news",
|
| 4 |
+
"home_url": "https://rapidapi.com/socialminer/api/instagram39/",
|
| 5 |
+
"name": "Instagram_v10",
|
| 6 |
+
"title": "Instagram",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "Instagram_v10",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 761,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 8.4,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "instagram39.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "getProfileByUserId",
|
| 20 |
+
"url": "https://instagram39.p.rapidapi.com/getProfileByUserId",
|
| 21 |
+
"description": "getProfileByUserId",
|
| 22 |
+
"method": "GET",
|
| 23 |
+
"required_parameters": [
|
| 24 |
+
{
|
| 25 |
+
"name": "user_id",
|
| 26 |
+
"type": "STRING",
|
| 27 |
+
"description": "",
|
| 28 |
+
"default": "1190758433"
|
| 29 |
+
}
|
| 30 |
+
],
|
| 31 |
+
"optional_parameters": [],
|
| 32 |
+
"code": "import requests\n\nurl = \"https://instagram39.p.rapidapi.com/getProfileByUserId\"\nquerystring = {\"user_id\": \"1190758433\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram39.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 33 |
+
"convert_code": "import requests\n\nurl = \"https://instagram39.p.rapidapi.com/getProfileByUserId\"\nquerystring = {\"user_id\": \"1190758433\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram39.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 34 |
+
"test_endpoint": ""
|
| 35 |
+
}
|
| 36 |
+
],
|
| 37 |
+
"standardized_name": "instagram_v10"
|
| 38 |
+
}
|
toolbench/toolenv/tools/Social/instagram_v10/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 getprofilebyuserid(user_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"getProfileByUserId"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram39.p.rapidapi.com/getprofilebyuserid"
|
| 15 |
+
querystring = {'user_id': user_id, }
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram39.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/Social/instagram_v11/api.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 getmediabycode(mediacode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"GetMediaByCode"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram64.p.rapidapi.com/ins/media_getmediabycode/go/"
|
| 15 |
+
querystring = {'mediaCode': mediacode, }
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram64.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 getmedialistbyusername(authorname: str, userid: str, page: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"GetMediaListByTag"
|
| 33 |
+
|
| 34 |
+
"""
|
| 35 |
+
url = f"https://instagram64.p.rapidapi.com/ins/media_getmedialistbyusername/go/"
|
| 36 |
+
querystring = {'authorName': authorname, 'userID': userid, 'page': page, }
|
| 37 |
+
|
| 38 |
+
headers = {
|
| 39 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 40 |
+
"X-RapidAPI-Host": "instagram64.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 getmedialistbytag(taginfo: str, lastendcursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 52 |
+
"""
|
| 53 |
+
"GetMediaListByTag"
|
| 54 |
+
|
| 55 |
+
"""
|
| 56 |
+
url = f"https://instagram64.p.rapidapi.com/ins/media_getmedialistbytag/go/"
|
| 57 |
+
querystring = {'tagInfo': taginfo, }
|
| 58 |
+
if lastendcursor:
|
| 59 |
+
querystring['lastEndCursor'] = lastendcursor
|
| 60 |
+
|
| 61 |
+
headers = {
|
| 62 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 63 |
+
"X-RapidAPI-Host": "instagram64.p.rapidapi.com"
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 68 |
+
try:
|
| 69 |
+
observation = response.json()
|
| 70 |
+
except:
|
| 71 |
+
observation = response.text
|
| 72 |
+
return observation
|
| 73 |
+
|
toolbench/toolenv/tools/Social/instagram_v12/api.py
ADDED
|
@@ -0,0 +1,529 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 user_guide_detail(guideid: str, next_max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get instagram user guide detail by guide id."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram188.p.rapidapi.com/userguidedetail/{guideid}/{next_max_id}"
|
| 15 |
+
querystring = {}
|
| 16 |
+
if next_max_id:
|
| 17 |
+
querystring['next_max_id'] = next_max_id
|
| 18 |
+
|
| 19 |
+
headers = {
|
| 20 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 21 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 26 |
+
try:
|
| 27 |
+
observation = response.json()
|
| 28 |
+
except:
|
| 29 |
+
observation = response.text
|
| 30 |
+
return observation
|
| 31 |
+
|
| 32 |
+
def user_tv_channel(count: int, userid: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 33 |
+
"""
|
| 34 |
+
"Get instagram user tv channel by user id."
|
| 35 |
+
count: 1 to 50
|
| 36 |
+
end_cursor: Pagination cursor.
|
| 37 |
+
To get next batch of data, paste here **end_cursor** value that you have received in previous request response.
|
| 38 |
+
|
| 39 |
+
"""
|
| 40 |
+
url = f"https://instagram188.p.rapidapi.com/usertv/{userid}/{count}/{end_cursor}"
|
| 41 |
+
querystring = {}
|
| 42 |
+
if end_cursor:
|
| 43 |
+
querystring['end_cursor'] = end_cursor
|
| 44 |
+
|
| 45 |
+
headers = {
|
| 46 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 47 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 52 |
+
try:
|
| 53 |
+
observation = response.json()
|
| 54 |
+
except:
|
| 55 |
+
observation = response.text
|
| 56 |
+
return observation
|
| 57 |
+
|
| 58 |
+
def user_following(userid: int, count: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 59 |
+
"""
|
| 60 |
+
"Get instagram user following by user id."
|
| 61 |
+
count: 1 to 50
|
| 62 |
+
end_cursor: Pagination cursor.
|
| 63 |
+
To get next batch of data, paste here **end_cursor** value that you have received in previous request response.
|
| 64 |
+
|
| 65 |
+
"""
|
| 66 |
+
url = f"https://instagram188.p.rapidapi.com/userfollowing/{userid}/{count}/{end_cursor}"
|
| 67 |
+
querystring = {}
|
| 68 |
+
if end_cursor:
|
| 69 |
+
querystring['end_cursor'] = end_cursor
|
| 70 |
+
|
| 71 |
+
headers = {
|
| 72 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 73 |
+
"X-RapidAPI-Host": "instagram188.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 |
+
|
| 84 |
+
def user_guides(userid: int, count: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 85 |
+
"""
|
| 86 |
+
"Get instagram user guides by user id."
|
| 87 |
+
count: 1 to 50
|
| 88 |
+
end_cursor: Pagination cursor.
|
| 89 |
+
To get next batch of data, paste here **end_cursor** value that you have received in previous request response.
|
| 90 |
+
|
| 91 |
+
"""
|
| 92 |
+
url = f"https://instagram188.p.rapidapi.com/userguides/{userid}/{count}/{end_cursor}"
|
| 93 |
+
querystring = {}
|
| 94 |
+
if end_cursor:
|
| 95 |
+
querystring['end_cursor'] = end_cursor
|
| 96 |
+
|
| 97 |
+
headers = {
|
| 98 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 99 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 104 |
+
try:
|
| 105 |
+
observation = response.json()
|
| 106 |
+
except:
|
| 107 |
+
observation = response.text
|
| 108 |
+
return observation
|
| 109 |
+
|
| 110 |
+
def user_highlight_detail(highlightid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 111 |
+
"""
|
| 112 |
+
"Get instagram user highlight detail by highlight id."
|
| 113 |
+
|
| 114 |
+
"""
|
| 115 |
+
url = f"https://instagram188.p.rapidapi.com/userhighlightdetail/{highlightid}"
|
| 116 |
+
querystring = {}
|
| 117 |
+
|
| 118 |
+
headers = {
|
| 119 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 120 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 125 |
+
try:
|
| 126 |
+
observation = response.json()
|
| 127 |
+
except:
|
| 128 |
+
observation = response.text
|
| 129 |
+
return observation
|
| 130 |
+
|
| 131 |
+
def user_stories(userid: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 132 |
+
"""
|
| 133 |
+
"Get instagram user stories by user id."
|
| 134 |
+
|
| 135 |
+
"""
|
| 136 |
+
url = f"https://instagram188.p.rapidapi.com/userstories/{userid}"
|
| 137 |
+
querystring = {}
|
| 138 |
+
|
| 139 |
+
headers = {
|
| 140 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 141 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 146 |
+
try:
|
| 147 |
+
observation = response.json()
|
| 148 |
+
except:
|
| 149 |
+
observation = response.text
|
| 150 |
+
return observation
|
| 151 |
+
|
| 152 |
+
def user_profile_picture(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 153 |
+
"""
|
| 154 |
+
"Get instagram user profile picture by username."
|
| 155 |
+
|
| 156 |
+
"""
|
| 157 |
+
url = f"https://instagram188.p.rapidapi.com/userphoto/{username}"
|
| 158 |
+
querystring = {}
|
| 159 |
+
|
| 160 |
+
headers = {
|
| 161 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 162 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 167 |
+
try:
|
| 168 |
+
observation = response.json()
|
| 169 |
+
except:
|
| 170 |
+
observation = response.text
|
| 171 |
+
return observation
|
| 172 |
+
|
| 173 |
+
def user_information(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 174 |
+
"""
|
| 175 |
+
"Get instagram user info by username."
|
| 176 |
+
username: **only username** demo: instagram.
|
| 177 |
+
If you paste the url it won't work.
|
| 178 |
+
|
| 179 |
+
"""
|
| 180 |
+
url = f"https://instagram188.p.rapidapi.com/userinfo/{username}"
|
| 181 |
+
querystring = {}
|
| 182 |
+
|
| 183 |
+
headers = {
|
| 184 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 185 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
|
| 189 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 190 |
+
try:
|
| 191 |
+
observation = response.json()
|
| 192 |
+
except:
|
| 193 |
+
observation = response.text
|
| 194 |
+
return observation
|
| 195 |
+
|
| 196 |
+
def user_posts(userid: str, count: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 197 |
+
"""
|
| 198 |
+
"Get instagram user posts by user id."
|
| 199 |
+
count: 1 to 50
|
| 200 |
+
end_cursor: Pagination cursor.
|
| 201 |
+
To get next batch of data, paste here **end_cursor** value that you have received in previous request response.
|
| 202 |
+
|
| 203 |
+
"""
|
| 204 |
+
url = f"https://instagram188.p.rapidapi.com/userpost/{userid}/{count}/{end_cursor}"
|
| 205 |
+
querystring = {}
|
| 206 |
+
if end_cursor:
|
| 207 |
+
querystring['end_cursor'] = end_cursor
|
| 208 |
+
|
| 209 |
+
headers = {
|
| 210 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 211 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
|
| 215 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 216 |
+
try:
|
| 217 |
+
observation = response.json()
|
| 218 |
+
except:
|
| 219 |
+
observation = response.text
|
| 220 |
+
return observation
|
| 221 |
+
|
| 222 |
+
def user_contact_info(userid: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 223 |
+
"""
|
| 224 |
+
"Get instagram user contact info by user id."
|
| 225 |
+
|
| 226 |
+
"""
|
| 227 |
+
url = f"https://instagram188.p.rapidapi.com/usercontact/{userid}"
|
| 228 |
+
querystring = {}
|
| 229 |
+
|
| 230 |
+
headers = {
|
| 231 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 232 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
|
| 236 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 237 |
+
try:
|
| 238 |
+
observation = response.json()
|
| 239 |
+
except:
|
| 240 |
+
observation = response.text
|
| 241 |
+
return observation
|
| 242 |
+
|
| 243 |
+
def userid(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 244 |
+
"""
|
| 245 |
+
"Get instagram user id by username"
|
| 246 |
+
|
| 247 |
+
"""
|
| 248 |
+
url = f"https://instagram188.p.rapidapi.com/userid/{username}"
|
| 249 |
+
querystring = {}
|
| 250 |
+
|
| 251 |
+
headers = {
|
| 252 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 253 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
|
| 257 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 258 |
+
try:
|
| 259 |
+
observation = response.json()
|
| 260 |
+
except:
|
| 261 |
+
observation = response.text
|
| 262 |
+
return observation
|
| 263 |
+
|
| 264 |
+
def similar_users(userid: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 265 |
+
"""
|
| 266 |
+
"Get similar Instagram users by userid."
|
| 267 |
+
|
| 268 |
+
"""
|
| 269 |
+
url = f"https://instagram188.p.rapidapi.com/usersimilaraccounts/{userid}"
|
| 270 |
+
querystring = {}
|
| 271 |
+
|
| 272 |
+
headers = {
|
| 273 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 274 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
|
| 278 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 279 |
+
try:
|
| 280 |
+
observation = response.json()
|
| 281 |
+
except:
|
| 282 |
+
observation = response.text
|
| 283 |
+
return observation
|
| 284 |
+
|
| 285 |
+
def comments50(shortcode: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 286 |
+
"""
|
| 287 |
+
"Get instagram user post comments data by shortcode."
|
| 288 |
+
|
| 289 |
+
"""
|
| 290 |
+
url = f"https://instagram188.p.rapidapi.com/postcomment50/{shortcode}/{end_cursor}"
|
| 291 |
+
querystring = {}
|
| 292 |
+
if end_cursor:
|
| 293 |
+
querystring['end_cursor'] = end_cursor
|
| 294 |
+
|
| 295 |
+
headers = {
|
| 296 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 297 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
|
| 301 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 302 |
+
try:
|
| 303 |
+
observation = response.json()
|
| 304 |
+
except:
|
| 305 |
+
observation = response.text
|
| 306 |
+
return observation
|
| 307 |
+
|
| 308 |
+
def user_tagged_posts(userid: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 309 |
+
"""
|
| 310 |
+
"Get instagram user tagged posts by user id."
|
| 311 |
+
end_cursor: Pagination cursor.
|
| 312 |
+
To get next batch of data, paste here **end_cursor** value that you have received in previous request response.
|
| 313 |
+
|
| 314 |
+
"""
|
| 315 |
+
url = f"https://instagram188.p.rapidapi.com/usertagpost/{userid}/{end_cursor}"
|
| 316 |
+
querystring = {}
|
| 317 |
+
if end_cursor:
|
| 318 |
+
querystring['end_cursor'] = end_cursor
|
| 319 |
+
|
| 320 |
+
headers = {
|
| 321 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 322 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
|
| 326 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 327 |
+
try:
|
| 328 |
+
observation = response.json()
|
| 329 |
+
except:
|
| 330 |
+
observation = response.text
|
| 331 |
+
return observation
|
| 332 |
+
|
| 333 |
+
def user_highlights_list(userid: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 334 |
+
"""
|
| 335 |
+
"Get instagram user highlights list by user id."
|
| 336 |
+
|
| 337 |
+
"""
|
| 338 |
+
url = f"https://instagram188.p.rapidapi.com/userhighlightslist/{userid}"
|
| 339 |
+
querystring = {}
|
| 340 |
+
|
| 341 |
+
headers = {
|
| 342 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 343 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 344 |
+
}
|
| 345 |
+
|
| 346 |
+
|
| 347 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 348 |
+
try:
|
| 349 |
+
observation = response.json()
|
| 350 |
+
except:
|
| 351 |
+
observation = response.text
|
| 352 |
+
return observation
|
| 353 |
+
|
| 354 |
+
def private_location_recent(locationid: int, page: int=None, next_media_ids: str=None, next_max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 355 |
+
"""
|
| 356 |
+
"Get Location Recent Posts"
|
| 357 |
+
page: return next_page data
|
| 358 |
+
for example:
|
| 359 |
+
1
|
| 360 |
+
|
| 361 |
+
next_media_ids: The returned next max id will be sent. One or more values can be returned.
|
| 362 |
+
sample:
|
| 363 |
+
2745847909738125069,2660487736245565317 **or** 2745847909738125069
|
| 364 |
+
next_max_id: for example:
|
| 365 |
+
QVFCa3c4OVZXUTNPMEZCT0FEQ3Q4Yjk4LWdCZHlUUDNzVzlNVE5HUHhiZ19pcFFTNE1FM3NwM2dFaE1mR3V4b242RXd0TEtvSG1zMDdnaEJsNS04b3BmRw==
|
| 366 |
+
|
| 367 |
+
"""
|
| 368 |
+
url = f"https://instagram188.p.rapidapi.com/locationrecenttest/{locationid}/{next_max_id}/{page}/{next_media_ids}"
|
| 369 |
+
querystring = {}
|
| 370 |
+
if page:
|
| 371 |
+
querystring['page'] = page
|
| 372 |
+
if next_media_ids:
|
| 373 |
+
querystring['next_media_ids'] = next_media_ids
|
| 374 |
+
if next_max_id:
|
| 375 |
+
querystring['next_max_id'] = next_max_id
|
| 376 |
+
|
| 377 |
+
headers = {
|
| 378 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 379 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
|
| 383 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 384 |
+
try:
|
| 385 |
+
observation = response.json()
|
| 386 |
+
except:
|
| 387 |
+
observation = response.text
|
| 388 |
+
return observation
|
| 389 |
+
|
| 390 |
+
def private_shortcode(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 391 |
+
"""
|
| 392 |
+
"Get instagram shortcode available."
|
| 393 |
+
|
| 394 |
+
"""
|
| 395 |
+
url = f"https://instagram188.p.rapidapi.com/privateshortcode/{shortcode}"
|
| 396 |
+
querystring = {}
|
| 397 |
+
|
| 398 |
+
headers = {
|
| 399 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 400 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 401 |
+
}
|
| 402 |
+
|
| 403 |
+
|
| 404 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 405 |
+
try:
|
| 406 |
+
observation = response.json()
|
| 407 |
+
except:
|
| 408 |
+
observation = response.text
|
| 409 |
+
return observation
|
| 410 |
+
|
| 411 |
+
def private_following(userid: int, password: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 412 |
+
"""
|
| 413 |
+
"Get instagram user following by user id."
|
| 414 |
+
|
| 415 |
+
"""
|
| 416 |
+
url = f"https://instagram188.p.rapidapi.com/privateuserfollowing/{userid}/{password}"
|
| 417 |
+
querystring = {}
|
| 418 |
+
|
| 419 |
+
headers = {
|
| 420 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 421 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
+
|
| 425 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 426 |
+
try:
|
| 427 |
+
observation = response.json()
|
| 428 |
+
except:
|
| 429 |
+
observation = response.text
|
| 430 |
+
return observation
|
| 431 |
+
|
| 432 |
+
def post_likes(shortcode: str, count: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 433 |
+
"""
|
| 434 |
+
"Get instagram user post likes data by shortcode."
|
| 435 |
+
count: 1 to 50
|
| 436 |
+
end_cursor: Pagination cursor.
|
| 437 |
+
To get next batch of data, paste here **end_cursor** value that you have received in previous request response.
|
| 438 |
+
|
| 439 |
+
"""
|
| 440 |
+
url = f"https://instagram188.p.rapidapi.com/postlike/{shortcode}/{count}/{end_cursor}"
|
| 441 |
+
querystring = {}
|
| 442 |
+
if end_cursor:
|
| 443 |
+
querystring['end_cursor'] = end_cursor
|
| 444 |
+
|
| 445 |
+
headers = {
|
| 446 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 447 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
|
| 451 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 452 |
+
try:
|
| 453 |
+
observation = response.json()
|
| 454 |
+
except:
|
| 455 |
+
observation = response.text
|
| 456 |
+
return observation
|
| 457 |
+
|
| 458 |
+
def post_comments(shortcode: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 459 |
+
"""
|
| 460 |
+
"Get instagram user post comments data by shortcode."
|
| 461 |
+
end_cursor: Pagination cursor.
|
| 462 |
+
To get next batch of data, paste here end_cursor value that you have received in previous request response.
|
| 463 |
+
|
| 464 |
+
"""
|
| 465 |
+
url = f"https://instagram188.p.rapidapi.com/postcomment/{shortcode}/{end_cursor}"
|
| 466 |
+
querystring = {}
|
| 467 |
+
if end_cursor:
|
| 468 |
+
querystring['end_cursor'] = end_cursor
|
| 469 |
+
|
| 470 |
+
headers = {
|
| 471 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 472 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 473 |
+
}
|
| 474 |
+
|
| 475 |
+
|
| 476 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 477 |
+
try:
|
| 478 |
+
observation = response.json()
|
| 479 |
+
except:
|
| 480 |
+
observation = response.text
|
| 481 |
+
return observation
|
| 482 |
+
|
| 483 |
+
def user_followers(count: int, userid: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 484 |
+
"""
|
| 485 |
+
"Get instagram user followers by user id."
|
| 486 |
+
count: 1 to 50
|
| 487 |
+
end_cursor: Pagination cursor.
|
| 488 |
+
To get next batch of data, paste here **end_cursor** value that you have received in previous request response.
|
| 489 |
+
|
| 490 |
+
"""
|
| 491 |
+
url = f"https://instagram188.p.rapidapi.com/userfollowers/{userid}/{count}/{end_cursor}"
|
| 492 |
+
querystring = {}
|
| 493 |
+
if end_cursor:
|
| 494 |
+
querystring['end_cursor'] = end_cursor
|
| 495 |
+
|
| 496 |
+
headers = {
|
| 497 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 498 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 499 |
+
}
|
| 500 |
+
|
| 501 |
+
|
| 502 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 503 |
+
try:
|
| 504 |
+
observation = response.json()
|
| 505 |
+
except:
|
| 506 |
+
observation = response.text
|
| 507 |
+
return observation
|
| 508 |
+
|
| 509 |
+
def post_detail(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 510 |
+
"""
|
| 511 |
+
"Get instagram user post detail by shortcode."
|
| 512 |
+
|
| 513 |
+
"""
|
| 514 |
+
url = f"https://instagram188.p.rapidapi.com/postinfo/{shortcode}"
|
| 515 |
+
querystring = {}
|
| 516 |
+
|
| 517 |
+
headers = {
|
| 518 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 519 |
+
"X-RapidAPI-Host": "instagram188.p.rapidapi.com"
|
| 520 |
+
}
|
| 521 |
+
|
| 522 |
+
|
| 523 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 524 |
+
try:
|
| 525 |
+
observation = response.json()
|
| 526 |
+
except:
|
| 527 |
+
observation = response.text
|
| 528 |
+
return observation
|
| 529 |
+
|
toolbench/toolen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-bdc0-78a180bfaad1",
|
| 3 |
+
"tool_description": "Real time Instagram Data! Plans with low price! Write a message for special plan!",
|
| 4 |
+
"home_url": "https://rapidapi.com/fullbelgesel/api/instagram204/",
|
| 5 |
+
"name": "Instagram_v13",
|
| 6 |
+
"title": "Instagram",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "Instagram_v13",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 0,
|
| 11 |
+
"avgLatency": 127257,
|
| 12 |
+
"avgSuccessRate": 0,
|
| 13 |
+
"popularityScore": 0.4,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "instagram204.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "User Guide Detail",
|
| 20 |
+
"url": "https://instagram204.p.rapidapi.com/userguidedetail/17917957043325668/{next_max_id}",
|
| 21 |
+
"description": "Get instagram user guide detail by guide id.",
|
| 22 |
+
"method": "GET",
|
| 23 |
+
"required_parameters": [
|
| 24 |
+
{
|
| 25 |
+
"name": "guideid",
|
| 26 |
+
"type": "STRING",
|
| 27 |
+
"description": "",
|
| 28 |
+
"default": "17917957043325668"
|
| 29 |
+
}
|
| 30 |
+
],
|
| 31 |
+
"optional_parameters": [
|
| 32 |
+
{
|
| 33 |
+
"name": "next_max_id",
|
| 34 |
+
"type": "string",
|
| 35 |
+
"description": "for example:\nQVFEbGFYVjdqXzJKNXNURGg1NUFTWG9LMFl2MnloRmNEQWdtd0FxX0g1c0lvbFhscVZheG1ybUtJMGR5UDBwTVUxSy1Va0xxVkxESVM5bnA1Yk5XaTI4Sg==",
|
| 36 |
+
"default": ""
|
| 37 |
+
}
|
| 38 |
+
],
|
| 39 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userguidedetail/17917957043325668/{next_max_id}\"\nquerystring = {\"next_max_id\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 40 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userguidedetail/{guideid}/{next_max_id}\"\nquerystring = {\"next_max_id\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 41 |
+
"test_endpoint": "",
|
| 42 |
+
"statuscode": 200,
|
| 43 |
+
"schema": {}
|
| 44 |
+
},
|
| 45 |
+
{
|
| 46 |
+
"name": "Similar Users",
|
| 47 |
+
"url": "https://instagram204.p.rapidapi.com/usersimilaraccounts/12281817",
|
| 48 |
+
"description": "Get similar Instagram users by userid.",
|
| 49 |
+
"method": "GET",
|
| 50 |
+
"required_parameters": [
|
| 51 |
+
{
|
| 52 |
+
"name": "userid",
|
| 53 |
+
"type": "NUMBER",
|
| 54 |
+
"description": "",
|
| 55 |
+
"default": "12281817"
|
| 56 |
+
}
|
| 57 |
+
],
|
| 58 |
+
"optional_parameters": [],
|
| 59 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/usersimilaraccounts/12281817\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 60 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/usersimilaraccounts/{userid}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 61 |
+
"test_endpoint": "",
|
| 62 |
+
"statuscode": 200,
|
| 63 |
+
"schema": {}
|
| 64 |
+
},
|
| 65 |
+
{
|
| 66 |
+
"name": "Post Comments",
|
| 67 |
+
"url": "https://instagram204.p.rapidapi.com/postcomment/CeWV2nHhLO8/{end_cursor}",
|
| 68 |
+
"description": "Get instagram user post comments data by shortcode.",
|
| 69 |
+
"method": "GET",
|
| 70 |
+
"required_parameters": [
|
| 71 |
+
{
|
| 72 |
+
"name": "shortcode",
|
| 73 |
+
"type": "string",
|
| 74 |
+
"description": "",
|
| 75 |
+
"default": "CeWV2nHhLO8"
|
| 76 |
+
}
|
| 77 |
+
],
|
| 78 |
+
"optional_parameters": [
|
| 79 |
+
{
|
| 80 |
+
"name": "end_cursor",
|
| 81 |
+
"type": "string",
|
| 82 |
+
"description": "",
|
| 83 |
+
"default": ""
|
| 84 |
+
}
|
| 85 |
+
],
|
| 86 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/postcomment/CeWV2nHhLO8/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 87 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/postcomment/{shortcode}/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 88 |
+
"test_endpoint": "",
|
| 89 |
+
"statuscode": 200,
|
| 90 |
+
"schema": {}
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"name": "Post Likes",
|
| 94 |
+
"url": "https://instagram204.p.rapidapi.com/postlike/CeWV2nHhLO8/12/{end_cursor}",
|
| 95 |
+
"description": "Get instagram user post likes data by shortcode.",
|
| 96 |
+
"method": "GET",
|
| 97 |
+
"required_parameters": [
|
| 98 |
+
{
|
| 99 |
+
"name": "count",
|
| 100 |
+
"type": "NUMBER",
|
| 101 |
+
"description": "Range from 1 to 50",
|
| 102 |
+
"default": "12"
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"name": "shortcode",
|
| 106 |
+
"type": "string",
|
| 107 |
+
"description": "",
|
| 108 |
+
"default": "CeWV2nHhLO8"
|
| 109 |
+
}
|
| 110 |
+
],
|
| 111 |
+
"optional_parameters": [
|
| 112 |
+
{
|
| 113 |
+
"name": "end_cursor",
|
| 114 |
+
"type": "string",
|
| 115 |
+
"description": "",
|
| 116 |
+
"default": ""
|
| 117 |
+
}
|
| 118 |
+
],
|
| 119 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/postlike/CeWV2nHhLO8/12/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 120 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/postlike/{shortcode}/{count}/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 121 |
+
"test_endpoint": "",
|
| 122 |
+
"statuscode": 200,
|
| 123 |
+
"schema": {}
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"name": "Post Detail Data",
|
| 127 |
+
"url": "https://instagram204.p.rapidapi.com/postinfo/CeWV2nHhLO8",
|
| 128 |
+
"description": "Get instagram user post detail by shortcode.",
|
| 129 |
+
"method": "GET",
|
| 130 |
+
"required_parameters": [
|
| 131 |
+
{
|
| 132 |
+
"name": "shortcode",
|
| 133 |
+
"type": "string",
|
| 134 |
+
"description": "Instagram post shortcode.",
|
| 135 |
+
"default": "CeWV2nHhLO8"
|
| 136 |
+
}
|
| 137 |
+
],
|
| 138 |
+
"optional_parameters": [],
|
| 139 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/postinfo/CeWV2nHhLO8\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 140 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/postinfo/{shortcode}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 141 |
+
"test_endpoint": "",
|
| 142 |
+
"statuscode": 200,
|
| 143 |
+
"schema": {}
|
| 144 |
+
},
|
| 145 |
+
{
|
| 146 |
+
"name": "User Tagged Posts",
|
| 147 |
+
"url": "https://instagram204.p.rapidapi.com/usertagpost/25025320/{end_cursor}",
|
| 148 |
+
"description": "Get instagram user tagged posts by user id.",
|
| 149 |
+
"method": "GET",
|
| 150 |
+
"required_parameters": [
|
| 151 |
+
{
|
| 152 |
+
"name": "userid",
|
| 153 |
+
"type": "string",
|
| 154 |
+
"description": "",
|
| 155 |
+
"default": "25025320"
|
| 156 |
+
}
|
| 157 |
+
],
|
| 158 |
+
"optional_parameters": [
|
| 159 |
+
{
|
| 160 |
+
"name": "end_cursor",
|
| 161 |
+
"type": "string",
|
| 162 |
+
"description": "",
|
| 163 |
+
"default": ""
|
| 164 |
+
}
|
| 165 |
+
],
|
| 166 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/usertagpost/25025320/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 167 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/usertagpost/{userid}/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 168 |
+
"test_endpoint": "",
|
| 169 |
+
"statuscode": 200,
|
| 170 |
+
"schema": {}
|
| 171 |
+
},
|
| 172 |
+
{
|
| 173 |
+
"name": "User Following",
|
| 174 |
+
"url": "https://instagram204.p.rapidapi.com/userfollowing/25025320/12/{end_cursor}",
|
| 175 |
+
"description": "Get instagram user following by user id.",
|
| 176 |
+
"method": "GET",
|
| 177 |
+
"required_parameters": [
|
| 178 |
+
{
|
| 179 |
+
"name": "count",
|
| 180 |
+
"type": "NUMBER",
|
| 181 |
+
"description": "Range from 1 to 50",
|
| 182 |
+
"default": "12"
|
| 183 |
+
},
|
| 184 |
+
{
|
| 185 |
+
"name": "userid",
|
| 186 |
+
"type": "NUMBER",
|
| 187 |
+
"description": "",
|
| 188 |
+
"default": "25025320"
|
| 189 |
+
}
|
| 190 |
+
],
|
| 191 |
+
"optional_parameters": [
|
| 192 |
+
{
|
| 193 |
+
"name": "end_cursor",
|
| 194 |
+
"type": "string",
|
| 195 |
+
"description": "",
|
| 196 |
+
"default": ""
|
| 197 |
+
}
|
| 198 |
+
],
|
| 199 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userfollowing/25025320/12/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 200 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userfollowing/{userid}/{count}/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 201 |
+
"test_endpoint": "",
|
| 202 |
+
"statuscode": 200,
|
| 203 |
+
"schema": {}
|
| 204 |
+
},
|
| 205 |
+
{
|
| 206 |
+
"name": "User Contact Info",
|
| 207 |
+
"url": "https://instagram204.p.rapidapi.com/usercontact/25025320",
|
| 208 |
+
"description": "Get instagram user contact info by user id.",
|
| 209 |
+
"method": "GET",
|
| 210 |
+
"required_parameters": [
|
| 211 |
+
{
|
| 212 |
+
"name": "userid",
|
| 213 |
+
"type": "string",
|
| 214 |
+
"description": "",
|
| 215 |
+
"default": "25025320"
|
| 216 |
+
}
|
| 217 |
+
],
|
| 218 |
+
"optional_parameters": [],
|
| 219 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/usercontact/25025320\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 220 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/usercontact/{userid}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 221 |
+
"test_endpoint": "",
|
| 222 |
+
"statuscode": 200,
|
| 223 |
+
"schema": {}
|
| 224 |
+
},
|
| 225 |
+
{
|
| 226 |
+
"name": "User Posts",
|
| 227 |
+
"url": "https://instagram204.p.rapidapi.com/userpost/12281817/12/{end_cursor}",
|
| 228 |
+
"description": "Get instagram user posts by user id.",
|
| 229 |
+
"method": "GET",
|
| 230 |
+
"required_parameters": [
|
| 231 |
+
{
|
| 232 |
+
"name": "userid",
|
| 233 |
+
"type": "NUMBER",
|
| 234 |
+
"description": "",
|
| 235 |
+
"default": "12281817"
|
| 236 |
+
},
|
| 237 |
+
{
|
| 238 |
+
"name": "count",
|
| 239 |
+
"type": "NUMBER",
|
| 240 |
+
"description": "Range from 1 to 50",
|
| 241 |
+
"default": "12"
|
| 242 |
+
}
|
| 243 |
+
],
|
| 244 |
+
"optional_parameters": [
|
| 245 |
+
{
|
| 246 |
+
"name": "end_cursor",
|
| 247 |
+
"type": "string",
|
| 248 |
+
"description": "",
|
| 249 |
+
"default": ""
|
| 250 |
+
}
|
| 251 |
+
],
|
| 252 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userpost/12281817/12/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 253 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userpost/{userid}/{count}/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 254 |
+
"test_endpoint": "",
|
| 255 |
+
"statuscode": 200,
|
| 256 |
+
"schema": {}
|
| 257 |
+
},
|
| 258 |
+
{
|
| 259 |
+
"name": "UserID",
|
| 260 |
+
"url": "https://instagram204.p.rapidapi.com/userid/instagram",
|
| 261 |
+
"description": "Get instagram user id by username",
|
| 262 |
+
"method": "GET",
|
| 263 |
+
"required_parameters": [
|
| 264 |
+
{
|
| 265 |
+
"name": "username",
|
| 266 |
+
"type": "string",
|
| 267 |
+
"description": "",
|
| 268 |
+
"default": "instagram"
|
| 269 |
+
}
|
| 270 |
+
],
|
| 271 |
+
"optional_parameters": [],
|
| 272 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userid/instagram\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 273 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userid/{username}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 274 |
+
"test_endpoint": "",
|
| 275 |
+
"statuscode": 200,
|
| 276 |
+
"schema": {}
|
| 277 |
+
},
|
| 278 |
+
{
|
| 279 |
+
"name": "User Highlights List",
|
| 280 |
+
"url": "https://instagram204.p.rapidapi.com/userhighlightslist/25025320",
|
| 281 |
+
"description": "Get instagram user highlights list by user id.",
|
| 282 |
+
"method": "GET",
|
| 283 |
+
"required_parameters": [
|
| 284 |
+
{
|
| 285 |
+
"name": "userid",
|
| 286 |
+
"type": "string",
|
| 287 |
+
"description": "",
|
| 288 |
+
"default": "25025320"
|
| 289 |
+
}
|
| 290 |
+
],
|
| 291 |
+
"optional_parameters": [],
|
| 292 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userhighlightslist/25025320\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 293 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userhighlightslist/{userid}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 294 |
+
"test_endpoint": "",
|
| 295 |
+
"statuscode": 200,
|
| 296 |
+
"schema": {}
|
| 297 |
+
},
|
| 298 |
+
{
|
| 299 |
+
"name": "User Stories",
|
| 300 |
+
"url": "https://instagram204.p.rapidapi.com/userstories/12281817",
|
| 301 |
+
"description": "Get instagram user stories by user id.",
|
| 302 |
+
"method": "GET",
|
| 303 |
+
"required_parameters": [
|
| 304 |
+
{
|
| 305 |
+
"name": "userid",
|
| 306 |
+
"type": "NUMBER",
|
| 307 |
+
"description": "",
|
| 308 |
+
"default": "12281817"
|
| 309 |
+
}
|
| 310 |
+
],
|
| 311 |
+
"optional_parameters": [],
|
| 312 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userstories/12281817\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 313 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userstories/{userid}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 314 |
+
"test_endpoint": "",
|
| 315 |
+
"statuscode": 200,
|
| 316 |
+
"schema": {}
|
| 317 |
+
},
|
| 318 |
+
{
|
| 319 |
+
"name": "User Tv Channel",
|
| 320 |
+
"url": "https://instagram204.p.rapidapi.com/usertv/25025320/12/{end_cursor}",
|
| 321 |
+
"description": "Get instagram user tv channel by user id.",
|
| 322 |
+
"method": "GET",
|
| 323 |
+
"required_parameters": [
|
| 324 |
+
{
|
| 325 |
+
"name": "count",
|
| 326 |
+
"type": "NUMBER",
|
| 327 |
+
"description": "Range from 1 to 50",
|
| 328 |
+
"default": "12"
|
| 329 |
+
},
|
| 330 |
+
{
|
| 331 |
+
"name": "userid",
|
| 332 |
+
"type": "NUMBER",
|
| 333 |
+
"description": "",
|
| 334 |
+
"default": "25025320"
|
| 335 |
+
}
|
| 336 |
+
],
|
| 337 |
+
"optional_parameters": [
|
| 338 |
+
{
|
| 339 |
+
"name": "end_cursor",
|
| 340 |
+
"type": "string",
|
| 341 |
+
"description": "",
|
| 342 |
+
"default": ""
|
| 343 |
+
}
|
| 344 |
+
],
|
| 345 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/usertv/25025320/12/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 346 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/usertv/{userid}/{count}/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 347 |
+
"test_endpoint": "",
|
| 348 |
+
"statuscode": 200,
|
| 349 |
+
"schema": {}
|
| 350 |
+
},
|
| 351 |
+
{
|
| 352 |
+
"name": "User Guides",
|
| 353 |
+
"url": "https://instagram204.p.rapidapi.com/userguides/25025320/12/{end_cursor}",
|
| 354 |
+
"description": "Get instagram user guides by user id.",
|
| 355 |
+
"method": "GET",
|
| 356 |
+
"required_parameters": [
|
| 357 |
+
{
|
| 358 |
+
"name": "userid",
|
| 359 |
+
"type": "NUMBER",
|
| 360 |
+
"description": "",
|
| 361 |
+
"default": "25025320"
|
| 362 |
+
},
|
| 363 |
+
{
|
| 364 |
+
"name": "count",
|
| 365 |
+
"type": "NUMBER",
|
| 366 |
+
"description": "Range from 1 to 50",
|
| 367 |
+
"default": "12"
|
| 368 |
+
}
|
| 369 |
+
],
|
| 370 |
+
"optional_parameters": [
|
| 371 |
+
{
|
| 372 |
+
"name": "end_cursor",
|
| 373 |
+
"type": "string",
|
| 374 |
+
"description": "",
|
| 375 |
+
"default": ""
|
| 376 |
+
}
|
| 377 |
+
],
|
| 378 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userguides/25025320/12/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 379 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userguides/{userid}/{count}/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 380 |
+
"test_endpoint": "",
|
| 381 |
+
"statuscode": 200,
|
| 382 |
+
"schema": {}
|
| 383 |
+
},
|
| 384 |
+
{
|
| 385 |
+
"name": "User Followers",
|
| 386 |
+
"url": "https://instagram204.p.rapidapi.com/userfollowers/25025320/12/{end_cursor}",
|
| 387 |
+
"description": "Get instagram user followers by user id.",
|
| 388 |
+
"method": "GET",
|
| 389 |
+
"required_parameters": [
|
| 390 |
+
{
|
| 391 |
+
"name": "count",
|
| 392 |
+
"type": "NUMBER",
|
| 393 |
+
"description": "Range from 1 to 50",
|
| 394 |
+
"default": "12"
|
| 395 |
+
},
|
| 396 |
+
{
|
| 397 |
+
"name": "userid",
|
| 398 |
+
"type": "NUMBER",
|
| 399 |
+
"description": "",
|
| 400 |
+
"default": "25025320"
|
| 401 |
+
}
|
| 402 |
+
],
|
| 403 |
+
"optional_parameters": [
|
| 404 |
+
{
|
| 405 |
+
"name": "end_cursor",
|
| 406 |
+
"type": "string",
|
| 407 |
+
"description": "",
|
| 408 |
+
"default": ""
|
| 409 |
+
}
|
| 410 |
+
],
|
| 411 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userfollowers/25025320/12/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 412 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userfollowers/{userid}/{count}/{end_cursor}\"\nquerystring = {\"end_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 413 |
+
"test_endpoint": "",
|
| 414 |
+
"statuscode": 200,
|
| 415 |
+
"schema": {}
|
| 416 |
+
},
|
| 417 |
+
{
|
| 418 |
+
"name": "User Profile Picture",
|
| 419 |
+
"url": "https://instagram204.p.rapidapi.com/userphoto/instagram",
|
| 420 |
+
"description": "Get instagram user profile picture by username.",
|
| 421 |
+
"method": "GET",
|
| 422 |
+
"required_parameters": [
|
| 423 |
+
{
|
| 424 |
+
"name": "username",
|
| 425 |
+
"type": "string",
|
| 426 |
+
"description": "",
|
| 427 |
+
"default": "instagram"
|
| 428 |
+
}
|
| 429 |
+
],
|
| 430 |
+
"optional_parameters": [],
|
| 431 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userphoto/instagram\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 432 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userphoto/{username}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 433 |
+
"test_endpoint": "",
|
| 434 |
+
"statuscode": 200,
|
| 435 |
+
"schema": {}
|
| 436 |
+
},
|
| 437 |
+
{
|
| 438 |
+
"name": "User Data",
|
| 439 |
+
"url": "https://instagram204.p.rapidapi.com/userinfo/instagram",
|
| 440 |
+
"description": "Get instagram user info by username.",
|
| 441 |
+
"method": "GET",
|
| 442 |
+
"required_parameters": [
|
| 443 |
+
{
|
| 444 |
+
"name": "username",
|
| 445 |
+
"type": "string",
|
| 446 |
+
"description": "",
|
| 447 |
+
"default": "instagram"
|
| 448 |
+
}
|
| 449 |
+
],
|
| 450 |
+
"optional_parameters": [],
|
| 451 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userinfo/instagram\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 452 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userinfo/{username}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 453 |
+
"test_endpoint": "",
|
| 454 |
+
"statuscode": 200,
|
| 455 |
+
"schema": {}
|
| 456 |
+
},
|
| 457 |
+
{
|
| 458 |
+
"name": "User Highlight Detail",
|
| 459 |
+
"url": "https://instagram204.p.rapidapi.com/userhighlightdetail/17951474176899044",
|
| 460 |
+
"description": "Get instagram user highlight detail by highlight id.",
|
| 461 |
+
"method": "GET",
|
| 462 |
+
"required_parameters": [
|
| 463 |
+
{
|
| 464 |
+
"name": "highlightid",
|
| 465 |
+
"type": "string",
|
| 466 |
+
"description": "",
|
| 467 |
+
"default": "17951474176899044"
|
| 468 |
+
}
|
| 469 |
+
],
|
| 470 |
+
"optional_parameters": [],
|
| 471 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userhighlightdetail/17951474176899044\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 472 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/userhighlightdetail/{highlightid}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 473 |
+
"test_endpoint": "",
|
| 474 |
+
"statuscode": 200,
|
| 475 |
+
"schema": {}
|
| 476 |
+
},
|
| 477 |
+
{
|
| 478 |
+
"name": "short Code Check",
|
| 479 |
+
"url": "https://instagram204.p.rapidapi.com/shortcodecheck/ChNXTUuJQiQ",
|
| 480 |
+
"description": "Instagram shortcode check endpoint",
|
| 481 |
+
"method": "GET",
|
| 482 |
+
"required_parameters": [
|
| 483 |
+
{
|
| 484 |
+
"name": "shortcode",
|
| 485 |
+
"type": "string",
|
| 486 |
+
"description": "",
|
| 487 |
+
"default": "ChNXTUuJQiQ"
|
| 488 |
+
}
|
| 489 |
+
],
|
| 490 |
+
"optional_parameters": [],
|
| 491 |
+
"code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/shortcodecheck/ChNXTUuJQiQ\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 492 |
+
"convert_code": "import requests\n\nurl = \"https://instagram204.p.rapidapi.com/shortcodecheck/{shortcode}\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram204.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 493 |
+
"test_endpoint": ""
|
| 494 |
+
}
|
| 495 |
+
],
|
| 496 |
+
"standardized_name": "instagram_v13"
|
| 497 |
+
}
|
toolbench/toolenv/tools/Social/instagram_v13/api.py
ADDED
|
@@ -0,0 +1,434 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 user_guide_detail(guideid: str, next_max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get instagram user guide detail by guide id."
|
| 12 |
+
next_max_id: for example:
|
| 13 |
+
QVFEbGFYVjdqXzJKNXNURGg1NUFTWG9LMFl2MnloRmNEQWdtd0FxX0g1c0lvbFhscVZheG1ybUtJMGR5UDBwTVUxSy1Va0xxVkxESVM5bnA1Yk5XaTI4Sg==
|
| 14 |
+
|
| 15 |
+
"""
|
| 16 |
+
url = f"https://instagram204.p.rapidapi.com/userguidedetail/{guideid}/{next_max_id}"
|
| 17 |
+
querystring = {}
|
| 18 |
+
if next_max_id:
|
| 19 |
+
querystring['next_max_id'] = next_max_id
|
| 20 |
+
|
| 21 |
+
headers = {
|
| 22 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 23 |
+
"X-RapidAPI-Host": "instagram204.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 similar_users(userid: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 35 |
+
"""
|
| 36 |
+
"Get similar Instagram users by userid."
|
| 37 |
+
|
| 38 |
+
"""
|
| 39 |
+
url = f"https://instagram204.p.rapidapi.com/usersimilaraccounts/{userid}"
|
| 40 |
+
querystring = {}
|
| 41 |
+
|
| 42 |
+
headers = {
|
| 43 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 44 |
+
"X-RapidAPI-Host": "instagram204.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 post_comments(shortcode: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 56 |
+
"""
|
| 57 |
+
"Get instagram user post comments data by shortcode."
|
| 58 |
+
|
| 59 |
+
"""
|
| 60 |
+
url = f"https://instagram204.p.rapidapi.com/postcomment/{shortcode}/{end_cursor}"
|
| 61 |
+
querystring = {}
|
| 62 |
+
if end_cursor:
|
| 63 |
+
querystring['end_cursor'] = end_cursor
|
| 64 |
+
|
| 65 |
+
headers = {
|
| 66 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 67 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 72 |
+
try:
|
| 73 |
+
observation = response.json()
|
| 74 |
+
except:
|
| 75 |
+
observation = response.text
|
| 76 |
+
return observation
|
| 77 |
+
|
| 78 |
+
def post_likes(count: int, shortcode: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 79 |
+
"""
|
| 80 |
+
"Get instagram user post likes data by shortcode."
|
| 81 |
+
count: Range from 1 to 50
|
| 82 |
+
|
| 83 |
+
"""
|
| 84 |
+
url = f"https://instagram204.p.rapidapi.com/postlike/{shortcode}/{count}/{end_cursor}"
|
| 85 |
+
querystring = {}
|
| 86 |
+
if end_cursor:
|
| 87 |
+
querystring['end_cursor'] = end_cursor
|
| 88 |
+
|
| 89 |
+
headers = {
|
| 90 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 91 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 96 |
+
try:
|
| 97 |
+
observation = response.json()
|
| 98 |
+
except:
|
| 99 |
+
observation = response.text
|
| 100 |
+
return observation
|
| 101 |
+
|
| 102 |
+
def post_detail_data(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 103 |
+
"""
|
| 104 |
+
"Get instagram user post detail by shortcode."
|
| 105 |
+
shortcode: Instagram post shortcode.
|
| 106 |
+
|
| 107 |
+
"""
|
| 108 |
+
url = f"https://instagram204.p.rapidapi.com/postinfo/{shortcode}"
|
| 109 |
+
querystring = {}
|
| 110 |
+
|
| 111 |
+
headers = {
|
| 112 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 113 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 118 |
+
try:
|
| 119 |
+
observation = response.json()
|
| 120 |
+
except:
|
| 121 |
+
observation = response.text
|
| 122 |
+
return observation
|
| 123 |
+
|
| 124 |
+
def user_tagged_posts(userid: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 125 |
+
"""
|
| 126 |
+
"Get instagram user tagged posts by user id."
|
| 127 |
+
|
| 128 |
+
"""
|
| 129 |
+
url = f"https://instagram204.p.rapidapi.com/usertagpost/{userid}/{end_cursor}"
|
| 130 |
+
querystring = {}
|
| 131 |
+
if end_cursor:
|
| 132 |
+
querystring['end_cursor'] = end_cursor
|
| 133 |
+
|
| 134 |
+
headers = {
|
| 135 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 136 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 141 |
+
try:
|
| 142 |
+
observation = response.json()
|
| 143 |
+
except:
|
| 144 |
+
observation = response.text
|
| 145 |
+
return observation
|
| 146 |
+
|
| 147 |
+
def user_following(count: int, userid: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 148 |
+
"""
|
| 149 |
+
"Get instagram user following by user id."
|
| 150 |
+
count: Range from 1 to 50
|
| 151 |
+
|
| 152 |
+
"""
|
| 153 |
+
url = f"https://instagram204.p.rapidapi.com/userfollowing/{userid}/{count}/{end_cursor}"
|
| 154 |
+
querystring = {}
|
| 155 |
+
if end_cursor:
|
| 156 |
+
querystring['end_cursor'] = end_cursor
|
| 157 |
+
|
| 158 |
+
headers = {
|
| 159 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 160 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 165 |
+
try:
|
| 166 |
+
observation = response.json()
|
| 167 |
+
except:
|
| 168 |
+
observation = response.text
|
| 169 |
+
return observation
|
| 170 |
+
|
| 171 |
+
def user_contact_info(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 172 |
+
"""
|
| 173 |
+
"Get instagram user contact info by user id."
|
| 174 |
+
|
| 175 |
+
"""
|
| 176 |
+
url = f"https://instagram204.p.rapidapi.com/usercontact/{userid}"
|
| 177 |
+
querystring = {}
|
| 178 |
+
|
| 179 |
+
headers = {
|
| 180 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 181 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 186 |
+
try:
|
| 187 |
+
observation = response.json()
|
| 188 |
+
except:
|
| 189 |
+
observation = response.text
|
| 190 |
+
return observation
|
| 191 |
+
|
| 192 |
+
def user_posts(userid: int, count: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 193 |
+
"""
|
| 194 |
+
"Get instagram user posts by user id."
|
| 195 |
+
count: Range from 1 to 50
|
| 196 |
+
|
| 197 |
+
"""
|
| 198 |
+
url = f"https://instagram204.p.rapidapi.com/userpost/{userid}/{count}/{end_cursor}"
|
| 199 |
+
querystring = {}
|
| 200 |
+
if end_cursor:
|
| 201 |
+
querystring['end_cursor'] = end_cursor
|
| 202 |
+
|
| 203 |
+
headers = {
|
| 204 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 205 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
|
| 209 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 210 |
+
try:
|
| 211 |
+
observation = response.json()
|
| 212 |
+
except:
|
| 213 |
+
observation = response.text
|
| 214 |
+
return observation
|
| 215 |
+
|
| 216 |
+
def userid(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 217 |
+
"""
|
| 218 |
+
"Get instagram user id by username"
|
| 219 |
+
|
| 220 |
+
"""
|
| 221 |
+
url = f"https://instagram204.p.rapidapi.com/userid/{username}"
|
| 222 |
+
querystring = {}
|
| 223 |
+
|
| 224 |
+
headers = {
|
| 225 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 226 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
|
| 230 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 231 |
+
try:
|
| 232 |
+
observation = response.json()
|
| 233 |
+
except:
|
| 234 |
+
observation = response.text
|
| 235 |
+
return observation
|
| 236 |
+
|
| 237 |
+
def user_highlights_list(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 238 |
+
"""
|
| 239 |
+
"Get instagram user highlights list by user id."
|
| 240 |
+
|
| 241 |
+
"""
|
| 242 |
+
url = f"https://instagram204.p.rapidapi.com/userhighlightslist/{userid}"
|
| 243 |
+
querystring = {}
|
| 244 |
+
|
| 245 |
+
headers = {
|
| 246 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 247 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
|
| 251 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 252 |
+
try:
|
| 253 |
+
observation = response.json()
|
| 254 |
+
except:
|
| 255 |
+
observation = response.text
|
| 256 |
+
return observation
|
| 257 |
+
|
| 258 |
+
def user_stories(userid: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 259 |
+
"""
|
| 260 |
+
"Get instagram user stories by user id."
|
| 261 |
+
|
| 262 |
+
"""
|
| 263 |
+
url = f"https://instagram204.p.rapidapi.com/userstories/{userid}"
|
| 264 |
+
querystring = {}
|
| 265 |
+
|
| 266 |
+
headers = {
|
| 267 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 268 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
|
| 272 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 273 |
+
try:
|
| 274 |
+
observation = response.json()
|
| 275 |
+
except:
|
| 276 |
+
observation = response.text
|
| 277 |
+
return observation
|
| 278 |
+
|
| 279 |
+
def user_tv_channel(count: int, userid: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 280 |
+
"""
|
| 281 |
+
"Get instagram user tv channel by user id."
|
| 282 |
+
count: Range from 1 to 50
|
| 283 |
+
|
| 284 |
+
"""
|
| 285 |
+
url = f"https://instagram204.p.rapidapi.com/usertv/{userid}/{count}/{end_cursor}"
|
| 286 |
+
querystring = {}
|
| 287 |
+
if end_cursor:
|
| 288 |
+
querystring['end_cursor'] = end_cursor
|
| 289 |
+
|
| 290 |
+
headers = {
|
| 291 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 292 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 293 |
+
}
|
| 294 |
+
|
| 295 |
+
|
| 296 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 297 |
+
try:
|
| 298 |
+
observation = response.json()
|
| 299 |
+
except:
|
| 300 |
+
observation = response.text
|
| 301 |
+
return observation
|
| 302 |
+
|
| 303 |
+
def user_guides(userid: int, count: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 304 |
+
"""
|
| 305 |
+
"Get instagram user guides by user id."
|
| 306 |
+
count: Range from 1 to 50
|
| 307 |
+
|
| 308 |
+
"""
|
| 309 |
+
url = f"https://instagram204.p.rapidapi.com/userguides/{userid}/{count}/{end_cursor}"
|
| 310 |
+
querystring = {}
|
| 311 |
+
if end_cursor:
|
| 312 |
+
querystring['end_cursor'] = end_cursor
|
| 313 |
+
|
| 314 |
+
headers = {
|
| 315 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 316 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
|
| 320 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 321 |
+
try:
|
| 322 |
+
observation = response.json()
|
| 323 |
+
except:
|
| 324 |
+
observation = response.text
|
| 325 |
+
return observation
|
| 326 |
+
|
| 327 |
+
def user_followers(count: int, userid: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 328 |
+
"""
|
| 329 |
+
"Get instagram user followers by user id."
|
| 330 |
+
count: Range from 1 to 50
|
| 331 |
+
|
| 332 |
+
"""
|
| 333 |
+
url = f"https://instagram204.p.rapidapi.com/userfollowers/{userid}/{count}/{end_cursor}"
|
| 334 |
+
querystring = {}
|
| 335 |
+
if end_cursor:
|
| 336 |
+
querystring['end_cursor'] = end_cursor
|
| 337 |
+
|
| 338 |
+
headers = {
|
| 339 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 340 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 341 |
+
}
|
| 342 |
+
|
| 343 |
+
|
| 344 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 345 |
+
try:
|
| 346 |
+
observation = response.json()
|
| 347 |
+
except:
|
| 348 |
+
observation = response.text
|
| 349 |
+
return observation
|
| 350 |
+
|
| 351 |
+
def user_profile_picture(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 352 |
+
"""
|
| 353 |
+
"Get instagram user profile picture by username."
|
| 354 |
+
|
| 355 |
+
"""
|
| 356 |
+
url = f"https://instagram204.p.rapidapi.com/userphoto/{username}"
|
| 357 |
+
querystring = {}
|
| 358 |
+
|
| 359 |
+
headers = {
|
| 360 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 361 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
|
| 365 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 366 |
+
try:
|
| 367 |
+
observation = response.json()
|
| 368 |
+
except:
|
| 369 |
+
observation = response.text
|
| 370 |
+
return observation
|
| 371 |
+
|
| 372 |
+
def user_data(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 373 |
+
"""
|
| 374 |
+
"Get instagram user info by username."
|
| 375 |
+
|
| 376 |
+
"""
|
| 377 |
+
url = f"https://instagram204.p.rapidapi.com/userinfo/{username}"
|
| 378 |
+
querystring = {}
|
| 379 |
+
|
| 380 |
+
headers = {
|
| 381 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 382 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 383 |
+
}
|
| 384 |
+
|
| 385 |
+
|
| 386 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 387 |
+
try:
|
| 388 |
+
observation = response.json()
|
| 389 |
+
except:
|
| 390 |
+
observation = response.text
|
| 391 |
+
return observation
|
| 392 |
+
|
| 393 |
+
def user_highlight_detail(highlightid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 394 |
+
"""
|
| 395 |
+
"Get instagram user highlight detail by highlight id."
|
| 396 |
+
|
| 397 |
+
"""
|
| 398 |
+
url = f"https://instagram204.p.rapidapi.com/userhighlightdetail/{highlightid}"
|
| 399 |
+
querystring = {}
|
| 400 |
+
|
| 401 |
+
headers = {
|
| 402 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 403 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 404 |
+
}
|
| 405 |
+
|
| 406 |
+
|
| 407 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 408 |
+
try:
|
| 409 |
+
observation = response.json()
|
| 410 |
+
except:
|
| 411 |
+
observation = response.text
|
| 412 |
+
return observation
|
| 413 |
+
|
| 414 |
+
def short_code_check(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 415 |
+
"""
|
| 416 |
+
"Instagram shortcode check endpoint"
|
| 417 |
+
|
| 418 |
+
"""
|
| 419 |
+
url = f"https://instagram204.p.rapidapi.com/shortcodecheck/{shortcode}"
|
| 420 |
+
querystring = {}
|
| 421 |
+
|
| 422 |
+
headers = {
|
| 423 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 424 |
+
"X-RapidAPI-Host": "instagram204.p.rapidapi.com"
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
|
| 428 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 429 |
+
try:
|
| 430 |
+
observation = response.json()
|
| 431 |
+
except:
|
| 432 |
+
observation = response.text
|
| 433 |
+
return observation
|
| 434 |
+
|
toolbench/toolenv/tools/Social/instagram_v14/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 user(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get user info by username"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram30.p.rapidapi.com/rapi/user/{username}"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram30.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 feed(cursor: str, is_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"User media feed by user id"
|
| 33 |
+
|
| 34 |
+
"""
|
| 35 |
+
url = f"https://instagram30.p.rapidapi.com/rapi/feed/{is_id}/{cursor}"
|
| 36 |
+
querystring = {}
|
| 37 |
+
|
| 38 |
+
headers = {
|
| 39 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 40 |
+
"X-RapidAPI-Host": "instagram30.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 search(text: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 52 |
+
"""
|
| 53 |
+
"search users, tags, paces"
|
| 54 |
+
|
| 55 |
+
"""
|
| 56 |
+
url = f"https://instagram30.p.rapidapi.com/rapi/search/{text}"
|
| 57 |
+
querystring = {}
|
| 58 |
+
|
| 59 |
+
headers = {
|
| 60 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 61 |
+
"X-RapidAPI-Host": "instagram30.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 followings(is_id: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 73 |
+
"""
|
| 74 |
+
"user followings list"
|
| 75 |
+
|
| 76 |
+
"""
|
| 77 |
+
url = f"https://instagram30.p.rapidapi.com/rapi/followings/{is_id}"
|
| 78 |
+
querystring = {}
|
| 79 |
+
|
| 80 |
+
headers = {
|
| 81 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 82 |
+
"X-RapidAPI-Host": "instagram30.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/Social/instagram_v15/api.py
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_feed_by_username(by: str, username: str, pageid: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get user feed by `username`, you can get the next page by providing `pageId` query string with `next_page` from the response."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram98.p.rapidapi.com/account/{username}/feed"
|
| 15 |
+
querystring = {'by': by, }
|
| 16 |
+
if pageid:
|
| 17 |
+
querystring['pageId'] = pageid
|
| 18 |
+
|
| 19 |
+
headers = {
|
| 20 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 21 |
+
"X-RapidAPI-Host": "instagram98.p.rapidapi.com"
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 26 |
+
try:
|
| 27 |
+
observation = response.json()
|
| 28 |
+
except:
|
| 29 |
+
observation = response.text
|
| 30 |
+
return observation
|
| 31 |
+
|
| 32 |
+
def get_info_by_username(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 33 |
+
"""
|
| 34 |
+
"Using this endpoint you will able to fetch user profile data using `username`, this includes user profile info and stats like media, followers and following counts, business data and more.
|
| 35 |
+
|
| 36 |
+
Query Parameters:
|
| 37 |
+
|
| 38 |
+
`by` indicates input type for finding the user can be `id` or `username` it's username by default"
|
| 39 |
+
|
| 40 |
+
"""
|
| 41 |
+
url = f"https://instagram98.p.rapidapi.com/account/{username}/info"
|
| 42 |
+
querystring = {}
|
| 43 |
+
|
| 44 |
+
headers = {
|
| 45 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 46 |
+
"X-RapidAPI-Host": "instagram98.p.rapidapi.com"
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 51 |
+
try:
|
| 52 |
+
observation = response.json()
|
| 53 |
+
except:
|
| 54 |
+
observation = response.text
|
| 55 |
+
return observation
|
| 56 |
+
|
| 57 |
+
def get_stories(user_ids: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 58 |
+
"""
|
| 59 |
+
"Using this endpoint you will able to fetch user stories using `user_id`. you can even provide multiple ids to fetch more stories with single API call, simple separate them by comma: `user_id_1`, `user_id_2`."
|
| 60 |
+
|
| 61 |
+
"""
|
| 62 |
+
url = f"https://instagram98.p.rapidapi.com/account/{user_ids}/stories"
|
| 63 |
+
querystring = {}
|
| 64 |
+
|
| 65 |
+
headers = {
|
| 66 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 67 |
+
"X-RapidAPI-Host": "instagram98.p.rapidapi.com"
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 72 |
+
try:
|
| 73 |
+
observation = response.json()
|
| 74 |
+
except:
|
| 75 |
+
observation = response.text
|
| 76 |
+
return observation
|
| 77 |
+
|
| 78 |
+
def get_info_by_id(user_id: str, by: str='id', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 79 |
+
"""
|
| 80 |
+
"Using this endpoint you will able to fetch user profile data using `id`, this includes user profile info and stats like media, followers and following counts, business data and more.
|
| 81 |
+
|
| 82 |
+
Query Parameters:
|
| 83 |
+
|
| 84 |
+
- `by` indicates input type for finding the user can be id or username it's username by default"
|
| 85 |
+
|
| 86 |
+
"""
|
| 87 |
+
url = f"https://instagram98.p.rapidapi.com/account/{user_id}/info"
|
| 88 |
+
querystring = {}
|
| 89 |
+
if by:
|
| 90 |
+
querystring['by'] = by
|
| 91 |
+
|
| 92 |
+
headers = {
|
| 93 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 94 |
+
"X-RapidAPI-Host": "instagram98.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 |
+
|
toolbench/toolenv/tools/Social/instagram_v16/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_profile_picture(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get the highest resolution profile picture of a Instagram user."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram73.p.rapidapi.com/api/"
|
| 15 |
+
querystring = {'username': username, }
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram73.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/Social/instagram_v17/api.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 user_data(lang: str, username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Request User Instagram Data from Username."
|
| 12 |
+
lang: Response Language (en &tr)
|
| 13 |
+
username: Username
|
| 14 |
+
|
| 15 |
+
"""
|
| 16 |
+
url = f"https://instagram9.p.rapidapi.com/api/instagram"
|
| 17 |
+
querystring = {'lang': lang, 'username': username, }
|
| 18 |
+
|
| 19 |
+
headers = {
|
| 20 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 21 |
+
"X-RapidAPI-Host": "instagram9.p.rapidapi.com"
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 26 |
+
try:
|
| 27 |
+
observation = response.json()
|
| 28 |
+
except:
|
| 29 |
+
observation = response.text
|
| 30 |
+
return observation
|
| 31 |
+
|
toolbench/toolenv/tools/Social/instagram_v18/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_user(is_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get User info by id"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram192.p.rapidapi.com/user/{is_id}"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram192.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/Social/instagram_v19/api.py
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 user_following_list(userid: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get a list of all accounts that the user is following"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram50.p.rapidapi.com/userfollowinglist"
|
| 15 |
+
querystring = {'userId': userid, }
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram50.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 igtv(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"Get all Instagram TV of the user"
|
| 33 |
+
|
| 34 |
+
"""
|
| 35 |
+
url = f"https://instagram50.p.rapidapi.com/userigtv"
|
| 36 |
+
querystring = {'username': username, }
|
| 37 |
+
|
| 38 |
+
headers = {
|
| 39 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 40 |
+
"X-RapidAPI-Host": "instagram50.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 user_details(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 52 |
+
"""
|
| 53 |
+
"Get a Instagram user info"
|
| 54 |
+
|
| 55 |
+
"""
|
| 56 |
+
url = f"https://instagram50.p.rapidapi.com/userdetails"
|
| 57 |
+
querystring = {'username': username, }
|
| 58 |
+
|
| 59 |
+
headers = {
|
| 60 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 61 |
+
"X-RapidAPI-Host": "instagram50.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 user_tagged_posts(userid: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 73 |
+
"""
|
| 74 |
+
"Get all posts where the user has been tagged"
|
| 75 |
+
|
| 76 |
+
"""
|
| 77 |
+
url = f"https://instagram50.p.rapidapi.com/"
|
| 78 |
+
querystring = {'userId': userid, }
|
| 79 |
+
|
| 80 |
+
headers = {
|
| 81 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 82 |
+
"X-RapidAPI-Host": "instagram50.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 |
+
|
| 93 |
+
def user_followers_list(userid: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 94 |
+
"""
|
| 95 |
+
"Get a list of all user followers"
|
| 96 |
+
|
| 97 |
+
"""
|
| 98 |
+
url = f"https://instagram50.p.rapidapi.com/userfollowerslist"
|
| 99 |
+
querystring = {'userId': userid, }
|
| 100 |
+
|
| 101 |
+
headers = {
|
| 102 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 103 |
+
"X-RapidAPI-Host": "instagram50.p.rapidapi.com"
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 108 |
+
try:
|
| 109 |
+
observation = response.json()
|
| 110 |
+
except:
|
| 111 |
+
observation = response.text
|
| 112 |
+
return observation
|
| 113 |
+
|
| 114 |
+
def user_stories(userid: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 115 |
+
"""
|
| 116 |
+
"Get all stories of a user"
|
| 117 |
+
|
| 118 |
+
"""
|
| 119 |
+
url = f"https://instagram50.p.rapidapi.com/userstories"
|
| 120 |
+
querystring = {'userId': userid, }
|
| 121 |
+
|
| 122 |
+
headers = {
|
| 123 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 124 |
+
"X-RapidAPI-Host": "instagram50.p.rapidapi.com"
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
|
| 128 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 129 |
+
try:
|
| 130 |
+
observation = response.json()
|
| 131 |
+
except:
|
| 132 |
+
observation = response.text
|
| 133 |
+
return observation
|
| 134 |
+
|
| 135 |
+
def related_accounts(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 136 |
+
"""
|
| 137 |
+
"All accounts related with a user"
|
| 138 |
+
|
| 139 |
+
"""
|
| 140 |
+
url = f"https://instagram50.p.rapidapi.com/relatedprofiles"
|
| 141 |
+
querystring = {'username': username, }
|
| 142 |
+
|
| 143 |
+
headers = {
|
| 144 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 145 |
+
"X-RapidAPI-Host": "instagram50.p.rapidapi.com"
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 150 |
+
try:
|
| 151 |
+
observation = response.json()
|
| 152 |
+
except:
|
| 153 |
+
observation = response.text
|
| 154 |
+
return observation
|
| 155 |
+
|
| 156 |
+
def user_post(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 157 |
+
"""
|
| 158 |
+
"Get all posts of a user"
|
| 159 |
+
|
| 160 |
+
"""
|
| 161 |
+
url = f"https://instagram50.p.rapidapi.com/userposts"
|
| 162 |
+
querystring = {'username': username, }
|
| 163 |
+
|
| 164 |
+
headers = {
|
| 165 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 166 |
+
"X-RapidAPI-Host": "instagram50.p.rapidapi.com"
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
|
| 170 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 171 |
+
try:
|
| 172 |
+
observation = response.json()
|
| 173 |
+
except:
|
| 174 |
+
observation = response.text
|
| 175 |
+
return observation
|
| 176 |
+
|
| 177 |
+
def user_highlights(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 178 |
+
"""
|
| 179 |
+
"Get all highlights of a user"
|
| 180 |
+
|
| 181 |
+
"""
|
| 182 |
+
url = f"https://instagram50.p.rapidapi.com/userhighlights"
|
| 183 |
+
querystring = {'username': username, }
|
| 184 |
+
|
| 185 |
+
headers = {
|
| 186 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 187 |
+
"X-RapidAPI-Host": "instagram50.p.rapidapi.com"
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 192 |
+
try:
|
| 193 |
+
observation = response.json()
|
| 194 |
+
except:
|
| 195 |
+
observation = response.text
|
| 196 |
+
return observation
|
| 197 |
+
|
toolbench/toolenv/tools/Social/instagram_v2.json
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_c0ecbec9-4f18-4dbc-b699-e8b7420e41ad",
|
| 3 |
+
"tool_description": "Instagram most needed endpoints",
|
| 4 |
+
"home_url": "https://rapidapi.com/thekirtan/api/instagram210/",
|
| 5 |
+
"name": "Instagram_v2",
|
| 6 |
+
"title": "Instagram",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "Instagram_v2",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 1101,
|
| 12 |
+
"avgSuccessRate": 96,
|
| 13 |
+
"popularityScore": 9.9,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "instagram210.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "Pk to Username",
|
| 20 |
+
"url": "https://instagram210.p.rapidapi.com/pk_to_username",
|
| 21 |
+
"description": "Find username from PK (userid)",
|
| 22 |
+
"method": "GET",
|
| 23 |
+
"required_parameters": [
|
| 24 |
+
{
|
| 25 |
+
"name": "pk",
|
| 26 |
+
"type": "STRING",
|
| 27 |
+
"description": "",
|
| 28 |
+
"default": "177402262"
|
| 29 |
+
}
|
| 30 |
+
],
|
| 31 |
+
"optional_parameters": [],
|
| 32 |
+
"code": "import requests\n\nurl = \"https://instagram210.p.rapidapi.com/pk_to_username\"\nquerystring = {\"pk\": \"177402262\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram210.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 33 |
+
"convert_code": "import requests\n\nurl = \"https://instagram210.p.rapidapi.com/pk_to_username\"\nquerystring = {\"pk\": \"177402262\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram210.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 34 |
+
"test_endpoint": ""
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"name": "Validate Username",
|
| 38 |
+
"url": "https://instagram210.p.rapidapi.com/username_validation",
|
| 39 |
+
"description": "Instagram Username validation",
|
| 40 |
+
"method": "GET",
|
| 41 |
+
"required_parameters": [
|
| 42 |
+
{
|
| 43 |
+
"name": "username",
|
| 44 |
+
"type": "STRING",
|
| 45 |
+
"description": "",
|
| 46 |
+
"default": "lelepons"
|
| 47 |
+
}
|
| 48 |
+
],
|
| 49 |
+
"optional_parameters": [],
|
| 50 |
+
"code": "import requests\n\nurl = \"https://instagram210.p.rapidapi.com/username_validation\"\nquerystring = {\"username\": \"lelepons\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram210.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 51 |
+
"convert_code": "import requests\n\nurl = \"https://instagram210.p.rapidapi.com/username_validation\"\nquerystring = {\"username\": \"lelepons\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram210.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 52 |
+
"test_endpoint": "",
|
| 53 |
+
"statuscode": 200,
|
| 54 |
+
"schema": {}
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"name": "Music Search",
|
| 58 |
+
"url": "https://instagram210.p.rapidapi.com/music",
|
| 59 |
+
"description": "Search music/sound/audio names and get artists cover and sounds url",
|
| 60 |
+
"method": "GET",
|
| 61 |
+
"required_parameters": [
|
| 62 |
+
{
|
| 63 |
+
"name": "query",
|
| 64 |
+
"type": "STRING",
|
| 65 |
+
"description": "Search Sounds/Audio name with artists/movie name\n\nE.g \nJustin Bieber Love me\n\n",
|
| 66 |
+
"default": "Titanic My Heart Will Go On"
|
| 67 |
+
}
|
| 68 |
+
],
|
| 69 |
+
"optional_parameters": [],
|
| 70 |
+
"code": "import requests\n\nurl = \"https://instagram210.p.rapidapi.com/music\"\nquerystring = {\"query\": \"Titanic My Heart Will Go On\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram210.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 71 |
+
"convert_code": "import requests\n\nurl = \"https://instagram210.p.rapidapi.com/music\"\nquerystring = {\"query\": \"Titanic My Heart Will Go On\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram210.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 72 |
+
"test_endpoint": "",
|
| 73 |
+
"statuscode": 200,
|
| 74 |
+
"schema": {}
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"name": "Search Locations",
|
| 78 |
+
"url": "https://instagram210.p.rapidapi.com/search_locations",
|
| 79 |
+
"description": "Location name search from keyword",
|
| 80 |
+
"method": "GET",
|
| 81 |
+
"required_parameters": [
|
| 82 |
+
{
|
| 83 |
+
"name": "name",
|
| 84 |
+
"type": "STRING",
|
| 85 |
+
"description": "",
|
| 86 |
+
"default": "toronto"
|
| 87 |
+
}
|
| 88 |
+
],
|
| 89 |
+
"optional_parameters": [],
|
| 90 |
+
"code": "import requests\n\nurl = \"https://instagram210.p.rapidapi.com/search_locations\"\nquerystring = {\"name\": \"toronto\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram210.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 91 |
+
"convert_code": "import requests\n\nurl = \"https://instagram210.p.rapidapi.com/search_locations\"\nquerystring = {\"name\": \"toronto\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram210.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 92 |
+
"test_endpoint": ""
|
| 93 |
+
},
|
| 94 |
+
{
|
| 95 |
+
"name": "Search Hashtags",
|
| 96 |
+
"url": "https://instagram210.p.rapidapi.com/search_hashtags",
|
| 97 |
+
"description": "Search tags name by keyword",
|
| 98 |
+
"method": "GET",
|
| 99 |
+
"required_parameters": [
|
| 100 |
+
{
|
| 101 |
+
"name": "name",
|
| 102 |
+
"type": "STRING",
|
| 103 |
+
"description": "",
|
| 104 |
+
"default": "fitness"
|
| 105 |
+
}
|
| 106 |
+
],
|
| 107 |
+
"optional_parameters": [],
|
| 108 |
+
"code": "import requests\n\nurl = \"https://instagram210.p.rapidapi.com/search_hashtags\"\nquerystring = {\"name\": \"fitness\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram210.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 109 |
+
"convert_code": "import requests\n\nurl = \"https://instagram210.p.rapidapi.com/search_hashtags\"\nquerystring = {\"name\": \"fitness\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram210.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 110 |
+
"test_endpoint": "",
|
| 111 |
+
"statuscode": 200,
|
| 112 |
+
"schema": {}
|
| 113 |
+
},
|
| 114 |
+
{
|
| 115 |
+
"name": "Profile",
|
| 116 |
+
"url": "https://instagram210.p.rapidapi.com/ig_profile",
|
| 117 |
+
"description": "Instagram Profile",
|
| 118 |
+
"method": "GET",
|
| 119 |
+
"required_parameters": [
|
| 120 |
+
{
|
| 121 |
+
"name": "ig",
|
| 122 |
+
"type": "STRING",
|
| 123 |
+
"description": "",
|
| 124 |
+
"default": "lelepons"
|
| 125 |
+
}
|
| 126 |
+
],
|
| 127 |
+
"optional_parameters": [],
|
| 128 |
+
"code": "import requests\n\nurl = \"https://instagram210.p.rapidapi.com/ig_profile\"\nquerystring = {\"ig\": \"lelepons\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram210.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 129 |
+
"convert_code": "import requests\n\nurl = \"https://instagram210.p.rapidapi.com/ig_profile\"\nquerystring = {\"ig\": \"lelepons\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram210.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 130 |
+
"test_endpoint": "",
|
| 131 |
+
"statuscode": 200,
|
| 132 |
+
"schema": {}
|
| 133 |
+
}
|
| 134 |
+
],
|
| 135 |
+
"standardized_name": "instagram_v2"
|
| 136 |
+
}
|
toolbench/toolenv/tools/Social/instagram_v2/api.py
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 pk_to_username(pk: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Find username from PK (userid)"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram210.p.rapidapi.com/pk_to_username"
|
| 15 |
+
querystring = {'pk': pk, }
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram210.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 validate_username(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"Instagram Username validation"
|
| 33 |
+
|
| 34 |
+
"""
|
| 35 |
+
url = f"https://instagram210.p.rapidapi.com/username_validation"
|
| 36 |
+
querystring = {'username': username, }
|
| 37 |
+
|
| 38 |
+
headers = {
|
| 39 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 40 |
+
"X-RapidAPI-Host": "instagram210.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 music_search(query: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 52 |
+
"""
|
| 53 |
+
"Search music/sound/audio names and get artists cover and sounds url"
|
| 54 |
+
query: Search Sounds/Audio name with artists/movie name
|
| 55 |
+
|
| 56 |
+
E.g
|
| 57 |
+
Justin Bieber Love me
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
"""
|
| 62 |
+
url = f"https://instagram210.p.rapidapi.com/music"
|
| 63 |
+
querystring = {'query': query, }
|
| 64 |
+
|
| 65 |
+
headers = {
|
| 66 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 67 |
+
"X-RapidAPI-Host": "instagram210.p.rapidapi.com"
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 72 |
+
try:
|
| 73 |
+
observation = response.json()
|
| 74 |
+
except:
|
| 75 |
+
observation = response.text
|
| 76 |
+
return observation
|
| 77 |
+
|
| 78 |
+
def search_locations(name: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 79 |
+
"""
|
| 80 |
+
"Location name search from keyword"
|
| 81 |
+
|
| 82 |
+
"""
|
| 83 |
+
url = f"https://instagram210.p.rapidapi.com/search_locations"
|
| 84 |
+
querystring = {'name': name, }
|
| 85 |
+
|
| 86 |
+
headers = {
|
| 87 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 88 |
+
"X-RapidAPI-Host": "instagram210.p.rapidapi.com"
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 93 |
+
try:
|
| 94 |
+
observation = response.json()
|
| 95 |
+
except:
|
| 96 |
+
observation = response.text
|
| 97 |
+
return observation
|
| 98 |
+
|
| 99 |
+
def search_hashtags(name: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 100 |
+
"""
|
| 101 |
+
"Search tags name by keyword"
|
| 102 |
+
|
| 103 |
+
"""
|
| 104 |
+
url = f"https://instagram210.p.rapidapi.com/search_hashtags"
|
| 105 |
+
querystring = {'name': name, }
|
| 106 |
+
|
| 107 |
+
headers = {
|
| 108 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 109 |
+
"X-RapidAPI-Host": "instagram210.p.rapidapi.com"
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 114 |
+
try:
|
| 115 |
+
observation = response.json()
|
| 116 |
+
except:
|
| 117 |
+
observation = response.text
|
| 118 |
+
return observation
|
| 119 |
+
|
| 120 |
+
def profile(ig: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 121 |
+
"""
|
| 122 |
+
"Instagram Profile"
|
| 123 |
+
|
| 124 |
+
"""
|
| 125 |
+
url = f"https://instagram210.p.rapidapi.com/ig_profile"
|
| 126 |
+
querystring = {'ig': ig, }
|
| 127 |
+
|
| 128 |
+
headers = {
|
| 129 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 130 |
+
"X-RapidAPI-Host": "instagram210.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 |
+
|
toolbench/toolenv/tools/Social/instagram_v20/api.py
ADDED
|
@@ -0,0 +1,449 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 user_guide_detail(guideid: str, next_max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get instagram user guide detail by guide id."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram203.p.rapidapi.com/userguidedetail/{guideid}/{next_max_id}"
|
| 15 |
+
querystring = {}
|
| 16 |
+
if next_max_id:
|
| 17 |
+
querystring['next_max_id'] = next_max_id
|
| 18 |
+
|
| 19 |
+
headers = {
|
| 20 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 21 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 26 |
+
try:
|
| 27 |
+
observation = response.json()
|
| 28 |
+
except:
|
| 29 |
+
observation = response.text
|
| 30 |
+
return observation
|
| 31 |
+
|
| 32 |
+
def user_information(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 33 |
+
"""
|
| 34 |
+
"Get instagram user info by username."
|
| 35 |
+
|
| 36 |
+
"""
|
| 37 |
+
url = f"https://instagram203.p.rapidapi.com/userinfo/{username}"
|
| 38 |
+
querystring = {}
|
| 39 |
+
|
| 40 |
+
headers = {
|
| 41 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 42 |
+
"X-RapidAPI-Host": "instagram203.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 user_highlights_list(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 54 |
+
"""
|
| 55 |
+
"Get instagram user highlights list by user id."
|
| 56 |
+
|
| 57 |
+
"""
|
| 58 |
+
url = f"https://instagram203.p.rapidapi.com/userhighlightslist/{userid}"
|
| 59 |
+
querystring = {}
|
| 60 |
+
|
| 61 |
+
headers = {
|
| 62 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 63 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 68 |
+
try:
|
| 69 |
+
observation = response.json()
|
| 70 |
+
except:
|
| 71 |
+
observation = response.text
|
| 72 |
+
return observation
|
| 73 |
+
|
| 74 |
+
def user_tv_channel(count: int, userid: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 75 |
+
"""
|
| 76 |
+
"Get instagram user tv channel by user id."
|
| 77 |
+
count: Range from 1 to 50
|
| 78 |
+
end_cursor: Pagination cursor.
|
| 79 |
+
To get next batch of data, paste here **end_cursor** value that you have received in previous request response.
|
| 80 |
+
|
| 81 |
+
"""
|
| 82 |
+
url = f"https://instagram203.p.rapidapi.com/usertv/{userid}/{count}/{end_cursor}"
|
| 83 |
+
querystring = {}
|
| 84 |
+
if end_cursor:
|
| 85 |
+
querystring['end_cursor'] = end_cursor
|
| 86 |
+
|
| 87 |
+
headers = {
|
| 88 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 89 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 94 |
+
try:
|
| 95 |
+
observation = response.json()
|
| 96 |
+
except:
|
| 97 |
+
observation = response.text
|
| 98 |
+
return observation
|
| 99 |
+
|
| 100 |
+
def user_tagged_posts(userid: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 101 |
+
"""
|
| 102 |
+
"Get instagram user tagged posts by user id."
|
| 103 |
+
|
| 104 |
+
"""
|
| 105 |
+
url = f"https://instagram203.p.rapidapi.com/usertagpost/{userid}/{end_cursor}"
|
| 106 |
+
querystring = {}
|
| 107 |
+
if end_cursor:
|
| 108 |
+
querystring['end_cursor'] = end_cursor
|
| 109 |
+
|
| 110 |
+
headers = {
|
| 111 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 112 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 117 |
+
try:
|
| 118 |
+
observation = response.json()
|
| 119 |
+
except:
|
| 120 |
+
observation = response.text
|
| 121 |
+
return observation
|
| 122 |
+
|
| 123 |
+
def user_stories(userid: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 124 |
+
"""
|
| 125 |
+
"Get instagram user stories by user id."
|
| 126 |
+
|
| 127 |
+
"""
|
| 128 |
+
url = f"https://instagram203.p.rapidapi.com/userstories/{userid}"
|
| 129 |
+
querystring = {}
|
| 130 |
+
|
| 131 |
+
headers = {
|
| 132 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 133 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 138 |
+
try:
|
| 139 |
+
observation = response.json()
|
| 140 |
+
except:
|
| 141 |
+
observation = response.text
|
| 142 |
+
return observation
|
| 143 |
+
|
| 144 |
+
def user_followers(count: int, userid: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 145 |
+
"""
|
| 146 |
+
"Get instagram user followers by user id."
|
| 147 |
+
count: Range from 1 to 100
|
| 148 |
+
end_cursor: Pagination cursor.
|
| 149 |
+
To get next batch of data, paste here **end_cursor** value that you have received in previous request response.
|
| 150 |
+
|
| 151 |
+
"""
|
| 152 |
+
url = f"https://instagram203.p.rapidapi.com/userfollowers/{userid}/{count}/{end_cursor}"
|
| 153 |
+
querystring = {}
|
| 154 |
+
if end_cursor:
|
| 155 |
+
querystring['end_cursor'] = end_cursor
|
| 156 |
+
|
| 157 |
+
headers = {
|
| 158 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 159 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 164 |
+
try:
|
| 165 |
+
observation = response.json()
|
| 166 |
+
except:
|
| 167 |
+
observation = response.text
|
| 168 |
+
return observation
|
| 169 |
+
|
| 170 |
+
def user_posts(count: int, userid: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 171 |
+
"""
|
| 172 |
+
"Get instagram user posts by user id."
|
| 173 |
+
count: Range from 1 to 50
|
| 174 |
+
end_cursor: Pagination cursor.
|
| 175 |
+
To get next batch of data, paste here **end_cursor** value that you have received in previous request response.
|
| 176 |
+
|
| 177 |
+
"""
|
| 178 |
+
url = f"https://instagram203.p.rapidapi.com/userpost/{userid}/{count}/{end_cursor}"
|
| 179 |
+
querystring = {}
|
| 180 |
+
if end_cursor:
|
| 181 |
+
querystring['end_cursor'] = end_cursor
|
| 182 |
+
|
| 183 |
+
headers = {
|
| 184 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 185 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
|
| 189 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 190 |
+
try:
|
| 191 |
+
observation = response.json()
|
| 192 |
+
except:
|
| 193 |
+
observation = response.text
|
| 194 |
+
return observation
|
| 195 |
+
|
| 196 |
+
def user_profile_picture(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 197 |
+
"""
|
| 198 |
+
"Get instagram user profile picture by username."
|
| 199 |
+
|
| 200 |
+
"""
|
| 201 |
+
url = f"https://instagram203.p.rapidapi.com/userphoto/{username}"
|
| 202 |
+
querystring = {}
|
| 203 |
+
|
| 204 |
+
headers = {
|
| 205 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 206 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 211 |
+
try:
|
| 212 |
+
observation = response.json()
|
| 213 |
+
except:
|
| 214 |
+
observation = response.text
|
| 215 |
+
return observation
|
| 216 |
+
|
| 217 |
+
def user_contact_info(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 218 |
+
"""
|
| 219 |
+
"Get instagram user contact info by user id."
|
| 220 |
+
|
| 221 |
+
"""
|
| 222 |
+
url = f"https://instagram203.p.rapidapi.com/usercontact/{userid}"
|
| 223 |
+
querystring = {}
|
| 224 |
+
|
| 225 |
+
headers = {
|
| 226 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 227 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
|
| 231 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 232 |
+
try:
|
| 233 |
+
observation = response.json()
|
| 234 |
+
except:
|
| 235 |
+
observation = response.text
|
| 236 |
+
return observation
|
| 237 |
+
|
| 238 |
+
def userid(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 239 |
+
"""
|
| 240 |
+
"Get instagram user id by username"
|
| 241 |
+
|
| 242 |
+
"""
|
| 243 |
+
url = f"https://instagram203.p.rapidapi.com/userid/{username}"
|
| 244 |
+
querystring = {}
|
| 245 |
+
|
| 246 |
+
headers = {
|
| 247 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 248 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
|
| 252 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 253 |
+
try:
|
| 254 |
+
observation = response.json()
|
| 255 |
+
except:
|
| 256 |
+
observation = response.text
|
| 257 |
+
return observation
|
| 258 |
+
|
| 259 |
+
def similar_users(userid: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 260 |
+
"""
|
| 261 |
+
"Get similar Instagram users by userid."
|
| 262 |
+
|
| 263 |
+
"""
|
| 264 |
+
url = f"https://instagram203.p.rapidapi.com/usersimilaraccounts/{userid}"
|
| 265 |
+
querystring = {}
|
| 266 |
+
|
| 267 |
+
headers = {
|
| 268 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 269 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
|
| 273 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 274 |
+
try:
|
| 275 |
+
observation = response.json()
|
| 276 |
+
except:
|
| 277 |
+
observation = response.text
|
| 278 |
+
return observation
|
| 279 |
+
|
| 280 |
+
def user_following(userid: int, count: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 281 |
+
"""
|
| 282 |
+
"Get instagram user following by user id."
|
| 283 |
+
count: Range from 1 to 100
|
| 284 |
+
end_cursor: Pagination cursor.
|
| 285 |
+
To get next batch of data, paste here **end_cursor** value that you have received in previous request response.
|
| 286 |
+
|
| 287 |
+
"""
|
| 288 |
+
url = f"https://instagram203.p.rapidapi.com/userfollowing/{userid}/{count}/{end_cursor}"
|
| 289 |
+
querystring = {}
|
| 290 |
+
if end_cursor:
|
| 291 |
+
querystring['end_cursor'] = end_cursor
|
| 292 |
+
|
| 293 |
+
headers = {
|
| 294 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 295 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
|
| 299 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 300 |
+
try:
|
| 301 |
+
observation = response.json()
|
| 302 |
+
except:
|
| 303 |
+
observation = response.text
|
| 304 |
+
return observation
|
| 305 |
+
|
| 306 |
+
def user_guides(userid: int, count: int, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 307 |
+
"""
|
| 308 |
+
"Get instagram user guides by user id."
|
| 309 |
+
count: Range from 1 to 50
|
| 310 |
+
end_cursor: Pagination cursor.
|
| 311 |
+
To get next batch of data, paste here **end_cursor** value that you have received in previous request response.
|
| 312 |
+
|
| 313 |
+
"""
|
| 314 |
+
url = f"https://instagram203.p.rapidapi.com/userguides/{userid}/{count}/{end_cursor}"
|
| 315 |
+
querystring = {}
|
| 316 |
+
if end_cursor:
|
| 317 |
+
querystring['end_cursor'] = end_cursor
|
| 318 |
+
|
| 319 |
+
headers = {
|
| 320 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 321 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
|
| 325 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 326 |
+
try:
|
| 327 |
+
observation = response.json()
|
| 328 |
+
except:
|
| 329 |
+
observation = response.text
|
| 330 |
+
return observation
|
| 331 |
+
|
| 332 |
+
def user_highlight_detail(highlightid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 333 |
+
"""
|
| 334 |
+
"Get instagram user highlight detail by highlight id."
|
| 335 |
+
|
| 336 |
+
"""
|
| 337 |
+
url = f"https://instagram203.p.rapidapi.com/userhighlightdetail/{highlightid}"
|
| 338 |
+
querystring = {}
|
| 339 |
+
|
| 340 |
+
headers = {
|
| 341 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 342 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
|
| 346 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 347 |
+
try:
|
| 348 |
+
observation = response.json()
|
| 349 |
+
except:
|
| 350 |
+
observation = response.text
|
| 351 |
+
return observation
|
| 352 |
+
|
| 353 |
+
def shortcode(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 354 |
+
"""
|
| 355 |
+
"Instagram shortcode special endpoint"
|
| 356 |
+
|
| 357 |
+
"""
|
| 358 |
+
url = f"https://instagram203.p.rapidapi.com/ifshortcode/{shortcode}"
|
| 359 |
+
querystring = {}
|
| 360 |
+
|
| 361 |
+
headers = {
|
| 362 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 363 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
|
| 367 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 368 |
+
try:
|
| 369 |
+
observation = response.json()
|
| 370 |
+
except:
|
| 371 |
+
observation = response.text
|
| 372 |
+
return observation
|
| 373 |
+
|
| 374 |
+
def post_likes(count: int, shortcode: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 375 |
+
"""
|
| 376 |
+
"Get instagram user post likes data by shortcode."
|
| 377 |
+
count: Range from 1 to 50
|
| 378 |
+
end_cursor: Pagination cursor.
|
| 379 |
+
To get next batch of data, paste here **end_cursor** value that you have received in previous request response.
|
| 380 |
+
|
| 381 |
+
"""
|
| 382 |
+
url = f"https://instagram203.p.rapidapi.com/postlike/{shortcode}/{count}/{end_cursor}"
|
| 383 |
+
querystring = {}
|
| 384 |
+
if end_cursor:
|
| 385 |
+
querystring['end_cursor'] = end_cursor
|
| 386 |
+
|
| 387 |
+
headers = {
|
| 388 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 389 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
|
| 393 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 394 |
+
try:
|
| 395 |
+
observation = response.json()
|
| 396 |
+
except:
|
| 397 |
+
observation = response.text
|
| 398 |
+
return observation
|
| 399 |
+
|
| 400 |
+
def post_comments(shortcode: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 401 |
+
"""
|
| 402 |
+
"Get instagram user post comments data by shortcode."
|
| 403 |
+
end_cursor: Pagination cursor.
|
| 404 |
+
To get next batch of data, paste here end_cursor value that you have received in previous request response.
|
| 405 |
+
|
| 406 |
+
for example:
|
| 407 |
+
{\"server_cursor\": \"QVFCVWdxME1RejFmTlNmVjM5b1EwMXV3TkVzREpic1J0TUZ1MDdUOGpIWUsza0pTejF1dEZJV2dJcjNFcmpPZVhNWEZPR2h6UWNCNkdMd2tGRHI3NG1icWlyRDZGYl9ZZFhtNnpic3ZncEhraFE=\", \"is_server_cursor_inverse\": true}
|
| 408 |
+
|
| 409 |
+
"""
|
| 410 |
+
url = f"https://instagram203.p.rapidapi.com/postcomment/{shortcode}/{end_cursor}"
|
| 411 |
+
querystring = {}
|
| 412 |
+
if end_cursor:
|
| 413 |
+
querystring['end_cursor'] = end_cursor
|
| 414 |
+
|
| 415 |
+
headers = {
|
| 416 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 417 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
|
| 421 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 422 |
+
try:
|
| 423 |
+
observation = response.json()
|
| 424 |
+
except:
|
| 425 |
+
observation = response.text
|
| 426 |
+
return observation
|
| 427 |
+
|
| 428 |
+
def post_detail_data(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 429 |
+
"""
|
| 430 |
+
"Get instagram user post detail by shortcode."
|
| 431 |
+
shortcode: Instagram post shortcode.
|
| 432 |
+
|
| 433 |
+
"""
|
| 434 |
+
url = f"https://instagram203.p.rapidapi.com/postinfo/{shortcode}"
|
| 435 |
+
querystring = {}
|
| 436 |
+
|
| 437 |
+
headers = {
|
| 438 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 439 |
+
"X-RapidAPI-Host": "instagram203.p.rapidapi.com"
|
| 440 |
+
}
|
| 441 |
+
|
| 442 |
+
|
| 443 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 444 |
+
try:
|
| 445 |
+
observation = response.json()
|
| 446 |
+
except:
|
| 447 |
+
observation = response.text
|
| 448 |
+
return observation
|
| 449 |
+
|
toolbench/toolenv/tools/Social/instagram_v3.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_af5a03e1-a296-4a62-9da3-31c38bf46abe",
|
| 3 |
+
"tool_description": "Fetch any data from Instagram: photo and video links, profile info, stories, highlights. Uptime 97%. Best price for 500k requests!",
|
| 4 |
+
"home_url": "https://rapidapi.com/3205/api/instagram120/",
|
| 5 |
+
"name": "instagram_v3",
|
| 6 |
+
"title": "instagram",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "instagram_v3",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 97,
|
| 11 |
+
"avgLatency": 2122,
|
| 12 |
+
"avgSuccessRate": 97,
|
| 13 |
+
"popularityScore": 9.9,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "instagram120.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "hls",
|
| 20 |
+
"url": "https://instagram120.p.rapidapi.com/api/instagram/hls",
|
| 21 |
+
"description": "hls => mp4 converter",
|
| 22 |
+
"method": "GET",
|
| 23 |
+
"required_parameters": [],
|
| 24 |
+
"optional_parameters": [],
|
| 25 |
+
"code": "import requests\n\nurl = \"https://instagram120.p.rapidapi.com/api/instagram/hls\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram120.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 26 |
+
"convert_code": "import requests\n\nurl = \"https://instagram120.p.rapidapi.com/api/instagram/hls\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram120.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 27 |
+
"test_endpoint": ""
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"name": "get",
|
| 31 |
+
"url": "https://instagram120.p.rapidapi.com/api/instagram/get",
|
| 32 |
+
"description": "Getting data bypassing CORS",
|
| 33 |
+
"method": "GET",
|
| 34 |
+
"required_parameters": [],
|
| 35 |
+
"optional_parameters": [],
|
| 36 |
+
"code": "import requests\n\nurl = \"https://instagram120.p.rapidapi.com/api/instagram/get\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram120.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 37 |
+
"convert_code": "import requests\n\nurl = \"https://instagram120.p.rapidapi.com/api/instagram/get\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram120.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 38 |
+
"test_endpoint": ""
|
| 39 |
+
}
|
| 40 |
+
],
|
| 41 |
+
"standardized_name": "instagram_v3"
|
| 42 |
+
}
|
toolbench/toolenv/tools/Social/instagram_v3/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 hls(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"hls => mp4 converter"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram120.p.rapidapi.com/api/instagram/hls"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram120.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 get(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"Getting data bypassing CORS"
|
| 33 |
+
|
| 34 |
+
"""
|
| 35 |
+
url = f"https://instagram120.p.rapidapi.com/api/instagram/get"
|
| 36 |
+
querystring = {}
|
| 37 |
+
|
| 38 |
+
headers = {
|
| 39 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 40 |
+
"X-RapidAPI-Host": "instagram120.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/Social/instagram_v4/api.py
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
from typing import Optional, Dict, Union, List
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def user_tagged_posts(user_id: str, count: int=12, cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"User Tagged Posts"
|
| 12 |
+
user_id: User ID
|
| 13 |
+
|
| 14 |
+
Use the `User Details By Username` endpoint to find the user ID from a username.
|
| 15 |
+
count: Number of Results
|
| 16 |
+
cursor: Cursor Token
|
| 17 |
+
|
| 18 |
+
"""
|
| 19 |
+
url = f"https://instagram191.p.rapidapi.com/user/tagged-posts/"
|
| 20 |
+
querystring = {'user_id': user_id, }
|
| 21 |
+
if count:
|
| 22 |
+
querystring['count'] = count
|
| 23 |
+
if cursor:
|
| 24 |
+
querystring['cursor'] = cursor
|
| 25 |
+
|
| 26 |
+
headers = {
|
| 27 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 28 |
+
"X-RapidAPI-Host": "instagram191.p.rapidapi.com"
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 33 |
+
try:
|
| 34 |
+
observation = response.json()
|
| 35 |
+
except:
|
| 36 |
+
observation = response.text
|
| 37 |
+
return observation
|
| 38 |
+
|
| 39 |
+
def user_reels(user_id: str, max_id: str=None, count: int=12, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 40 |
+
"""
|
| 41 |
+
"User Reels"
|
| 42 |
+
user_id: User ID
|
| 43 |
+
|
| 44 |
+
Use the `User Details By Username` endpoint to find the user ID from a username.
|
| 45 |
+
max_id: Max ID
|
| 46 |
+
count: Number of Results
|
| 47 |
+
|
| 48 |
+
"""
|
| 49 |
+
url = f"https://instagram191.p.rapidapi.com/user/reels/"
|
| 50 |
+
querystring = {'user_id': user_id, }
|
| 51 |
+
if max_id:
|
| 52 |
+
querystring['max_id'] = max_id
|
| 53 |
+
if count:
|
| 54 |
+
querystring['count'] = count
|
| 55 |
+
|
| 56 |
+
headers = {
|
| 57 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 58 |
+
"X-RapidAPI-Host": "instagram191.p.rapidapi.com"
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 63 |
+
try:
|
| 64 |
+
observation = response.json()
|
| 65 |
+
except:
|
| 66 |
+
observation = response.text
|
| 67 |
+
return observation
|
| 68 |
+
|
| 69 |
+
def user_highlights(user_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 70 |
+
"""
|
| 71 |
+
"User Highlights"
|
| 72 |
+
user_id: User ID
|
| 73 |
+
|
| 74 |
+
Use the `User Details By Username` endpoint to find the user ID from a username.
|
| 75 |
+
|
| 76 |
+
"""
|
| 77 |
+
url = f"https://instagram191.p.rapidapi.com/user/highlights/"
|
| 78 |
+
querystring = {'user_id': user_id, }
|
| 79 |
+
|
| 80 |
+
headers = {
|
| 81 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 82 |
+
"X-RapidAPI-Host": "instagram191.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 |
+
|
| 93 |
+
def user_live_status(user_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 94 |
+
"""
|
| 95 |
+
"User Live Status"
|
| 96 |
+
user_id: User ID
|
| 97 |
+
|
| 98 |
+
Use the `User Details By Username` endpoint to find the user ID from a username.
|
| 99 |
+
|
| 100 |
+
"""
|
| 101 |
+
url = f"https://instagram191.p.rapidapi.com/user/live-status/"
|
| 102 |
+
querystring = {'user_id': user_id, }
|
| 103 |
+
|
| 104 |
+
headers = {
|
| 105 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 106 |
+
"X-RapidAPI-Host": "instagram191.p.rapidapi.com"
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 111 |
+
try:
|
| 112 |
+
observation = response.json()
|
| 113 |
+
except:
|
| 114 |
+
observation = response.text
|
| 115 |
+
return observation
|
| 116 |
+
|
| 117 |
+
def user_guides(user_id: str, max_id: str=None, count: int=12, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 118 |
+
"""
|
| 119 |
+
"User Guides"
|
| 120 |
+
user_id: User ID
|
| 121 |
+
|
| 122 |
+
Use the `User Details By Username` endpoint to find the user ID from a username.
|
| 123 |
+
max_id: Max ID
|
| 124 |
+
count: Number of Results
|
| 125 |
+
|
| 126 |
+
"""
|
| 127 |
+
url = f"https://instagram191.p.rapidapi.com/user/guides/"
|
| 128 |
+
querystring = {'user_id': user_id, }
|
| 129 |
+
if max_id:
|
| 130 |
+
querystring['max_id'] = max_id
|
| 131 |
+
if count:
|
| 132 |
+
querystring['count'] = count
|
| 133 |
+
|
| 134 |
+
headers = {
|
| 135 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 136 |
+
"X-RapidAPI-Host": "instagram191.p.rapidapi.com"
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 141 |
+
try:
|
| 142 |
+
observation = response.json()
|
| 143 |
+
except:
|
| 144 |
+
observation = response.text
|
| 145 |
+
return observation
|
| 146 |
+
|
| 147 |
+
def user_following_hashtags(user_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 148 |
+
"""
|
| 149 |
+
"User Following Hashtags"
|
| 150 |
+
user_id: User ID
|
| 151 |
+
|
| 152 |
+
Use the `User Details By Username` endpoint to find the user ID from a username.
|
| 153 |
+
|
| 154 |
+
"""
|
| 155 |
+
url = f"https://instagram191.p.rapidapi.com/user/following-hashtags/"
|
| 156 |
+
querystring = {'user_id': user_id, }
|
| 157 |
+
|
| 158 |
+
headers = {
|
| 159 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 160 |
+
"X-RapidAPI-Host": "instagram191.p.rapidapi.com"
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 165 |
+
try:
|
| 166 |
+
observation = response.json()
|
| 167 |
+
except:
|
| 168 |
+
observation = response.text
|
| 169 |
+
return observation
|
| 170 |
+
|
| 171 |
+
def user_details_by_username(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 172 |
+
"""
|
| 173 |
+
"User Details By Username"
|
| 174 |
+
username: Username
|
| 175 |
+
|
| 176 |
+
"""
|
| 177 |
+
url = f"https://instagram191.p.rapidapi.com/user/details-by-username/"
|
| 178 |
+
querystring = {'username': username, }
|
| 179 |
+
|
| 180 |
+
headers = {
|
| 181 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 182 |
+
"X-RapidAPI-Host": "instagram191.p.rapidapi.com"
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
|
| 186 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 187 |
+
try:
|
| 188 |
+
observation = response.json()
|
| 189 |
+
except:
|
| 190 |
+
observation = response.text
|
| 191 |
+
return observation
|
| 192 |
+
|
| 193 |
+
def user_posts(user_id: str, count: int=12, cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 194 |
+
"""
|
| 195 |
+
"User Posts"
|
| 196 |
+
user_id: User ID
|
| 197 |
+
|
| 198 |
+
Use the `User Details By Username` endpoint to find the user ID from a username.
|
| 199 |
+
count: Number of Results
|
| 200 |
+
cursor: Cursor Token
|
| 201 |
+
|
| 202 |
+
"""
|
| 203 |
+
url = f"https://instagram191.p.rapidapi.com/user/posts/"
|
| 204 |
+
querystring = {'user_id': user_id, }
|
| 205 |
+
if count:
|
| 206 |
+
querystring['count'] = count
|
| 207 |
+
if cursor:
|
| 208 |
+
querystring['cursor'] = cursor
|
| 209 |
+
|
| 210 |
+
headers = {
|
| 211 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 212 |
+
"X-RapidAPI-Host": "instagram191.p.rapidapi.com"
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
|
| 216 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 217 |
+
try:
|
| 218 |
+
observation = response.json()
|
| 219 |
+
except:
|
| 220 |
+
observation = response.text
|
| 221 |
+
return observation
|
| 222 |
+
|
| 223 |
+
def search(query: str, context: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 224 |
+
"""
|
| 225 |
+
"Search"
|
| 226 |
+
query: Search Query
|
| 227 |
+
context: Search Type
|
| 228 |
+
|
| 229 |
+
Default: `blended`
|
| 230 |
+
|
| 231 |
+
"""
|
| 232 |
+
url = f"https://instagram191.p.rapidapi.com/search/"
|
| 233 |
+
querystring = {'query': query, }
|
| 234 |
+
if context:
|
| 235 |
+
querystring['context'] = context
|
| 236 |
+
|
| 237 |
+
headers = {
|
| 238 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 239 |
+
"X-RapidAPI-Host": "instagram191.p.rapidapi.com"
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
|
| 243 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 244 |
+
try:
|
| 245 |
+
observation = response.json()
|
| 246 |
+
except:
|
| 247 |
+
observation = response.text
|
| 248 |
+
return observation
|
| 249 |
+
|
| 250 |
+
def guide_items(guide_id: str, max_id: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 251 |
+
"""
|
| 252 |
+
"Guide Items"
|
| 253 |
+
guide_id: Guide ID
|
| 254 |
+
max_id: Max ID
|
| 255 |
+
|
| 256 |
+
"""
|
| 257 |
+
url = f"https://instagram191.p.rapidapi.com/guide/items/"
|
| 258 |
+
querystring = {'guide_id': guide_id, }
|
| 259 |
+
if max_id:
|
| 260 |
+
querystring['max_id'] = max_id
|
| 261 |
+
|
| 262 |
+
headers = {
|
| 263 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 264 |
+
"X-RapidAPI-Host": "instagram191.p.rapidapi.com"
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
|
| 268 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 269 |
+
try:
|
| 270 |
+
observation = response.json()
|
| 271 |
+
except:
|
| 272 |
+
observation = response.text
|
| 273 |
+
return observation
|
| 274 |
+
|
| 275 |
+
def guide_details(guide_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 276 |
+
"""
|
| 277 |
+
"Guide Details"
|
| 278 |
+
guide_id: Guide ID
|
| 279 |
+
|
| 280 |
+
"""
|
| 281 |
+
url = f"https://instagram191.p.rapidapi.com/guide/details/"
|
| 282 |
+
querystring = {'guide_id': guide_id, }
|
| 283 |
+
|
| 284 |
+
headers = {
|
| 285 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 286 |
+
"X-RapidAPI-Host": "instagram191.p.rapidapi.com"
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
|
| 290 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 291 |
+
try:
|
| 292 |
+
observation = response.json()
|
| 293 |
+
except:
|
| 294 |
+
observation = response.text
|
| 295 |
+
return observation
|
| 296 |
+
|
toolbench/toolenv/tools/Social/instagram_v5.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 post_likes(count: str, shortcode: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Get Instagram user post likes data by Instagram shortcode."
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram243.p.rapidapi.com/postlikes/{shortcode}/{count}/{end_cursor}"
|
| 15 |
+
querystring = {}
|
| 16 |
+
if end_cursor:
|
| 17 |
+
querystring['end_cursor'] = end_cursor
|
| 18 |
+
|
| 19 |
+
headers = {
|
| 20 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 21 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 26 |
+
try:
|
| 27 |
+
observation = response.json()
|
| 28 |
+
except:
|
| 29 |
+
observation = response.text
|
| 30 |
+
return observation
|
| 31 |
+
|
| 32 |
+
def post_detail(shortcode: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 33 |
+
"""
|
| 34 |
+
"Get Instagram user post detail by Instagram shortcode."
|
| 35 |
+
|
| 36 |
+
"""
|
| 37 |
+
url = f"https://instagram243.p.rapidapi.com/postdetail/{shortcode}"
|
| 38 |
+
querystring = {}
|
| 39 |
+
|
| 40 |
+
headers = {
|
| 41 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 42 |
+
"X-RapidAPI-Host": "instagram243.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 post_comments(shortcode: str, end_cursor: str=None, scraperid: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 54 |
+
"""
|
| 55 |
+
"Get Instagram user post comments by Instagram shortcode."
|
| 56 |
+
|
| 57 |
+
"""
|
| 58 |
+
url = f"https://instagram243.p.rapidapi.com/postcomments/{shortcode}/{end_cursor}/{scraperid}"
|
| 59 |
+
querystring = {}
|
| 60 |
+
if end_cursor:
|
| 61 |
+
querystring['end_cursor'] = end_cursor
|
| 62 |
+
if scraperid:
|
| 63 |
+
querystring['scraperid'] = scraperid
|
| 64 |
+
|
| 65 |
+
headers = {
|
| 66 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 67 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 72 |
+
try:
|
| 73 |
+
observation = response.json()
|
| 74 |
+
except:
|
| 75 |
+
observation = response.text
|
| 76 |
+
return observation
|
| 77 |
+
|
| 78 |
+
def user_guide_detail(guideid: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 79 |
+
"""
|
| 80 |
+
"Get Instagram user guide detail by Instagram guide id."
|
| 81 |
+
|
| 82 |
+
"""
|
| 83 |
+
url = f"https://instagram243.p.rapidapi.com/guidedetail/{guideid}/{end_cursor}"
|
| 84 |
+
querystring = {}
|
| 85 |
+
if end_cursor:
|
| 86 |
+
querystring['end_cursor'] = end_cursor
|
| 87 |
+
|
| 88 |
+
headers = {
|
| 89 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 90 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 95 |
+
try:
|
| 96 |
+
observation = response.json()
|
| 97 |
+
except:
|
| 98 |
+
observation = response.text
|
| 99 |
+
return observation
|
| 100 |
+
|
| 101 |
+
def user_guides(userid: str, count: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 102 |
+
"""
|
| 103 |
+
"Get Instagram user guides by Instagram user id."
|
| 104 |
+
|
| 105 |
+
"""
|
| 106 |
+
url = f"https://instagram243.p.rapidapi.com/userguides/{userid}/{count}/{end_cursor}"
|
| 107 |
+
querystring = {}
|
| 108 |
+
if end_cursor:
|
| 109 |
+
querystring['end_cursor'] = end_cursor
|
| 110 |
+
|
| 111 |
+
headers = {
|
| 112 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 113 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 118 |
+
try:
|
| 119 |
+
observation = response.json()
|
| 120 |
+
except:
|
| 121 |
+
observation = response.text
|
| 122 |
+
return observation
|
| 123 |
+
|
| 124 |
+
def user_stories(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 125 |
+
"""
|
| 126 |
+
"Get Instagram user stories by Instagram user id."
|
| 127 |
+
|
| 128 |
+
"""
|
| 129 |
+
url = f"https://instagram243.p.rapidapi.com/userstories/{userid}"
|
| 130 |
+
querystring = {}
|
| 131 |
+
|
| 132 |
+
headers = {
|
| 133 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 134 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 139 |
+
try:
|
| 140 |
+
observation = response.json()
|
| 141 |
+
except:
|
| 142 |
+
observation = response.text
|
| 143 |
+
return observation
|
| 144 |
+
|
| 145 |
+
def user_tv_channel(count: str, userid: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 146 |
+
"""
|
| 147 |
+
"Get Instagram user tv channel by Instagram user id."
|
| 148 |
+
|
| 149 |
+
"""
|
| 150 |
+
url = f"https://instagram243.p.rapidapi.com/usertvchannel/{userid}/{count}/{end_cursor}"
|
| 151 |
+
querystring = {}
|
| 152 |
+
if end_cursor:
|
| 153 |
+
querystring['end_cursor'] = end_cursor
|
| 154 |
+
|
| 155 |
+
headers = {
|
| 156 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 157 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 162 |
+
try:
|
| 163 |
+
observation = response.json()
|
| 164 |
+
except:
|
| 165 |
+
observation = response.text
|
| 166 |
+
return observation
|
| 167 |
+
|
| 168 |
+
def highlight_detail(highlightid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 169 |
+
"""
|
| 170 |
+
"Get Instagram highlight detail by Instagram highlight id."
|
| 171 |
+
|
| 172 |
+
"""
|
| 173 |
+
url = f"https://instagram243.p.rapidapi.com/highlightdetail/{highlightid}"
|
| 174 |
+
querystring = {}
|
| 175 |
+
|
| 176 |
+
headers = {
|
| 177 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 178 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 183 |
+
try:
|
| 184 |
+
observation = response.json()
|
| 185 |
+
except:
|
| 186 |
+
observation = response.text
|
| 187 |
+
return observation
|
| 188 |
+
|
| 189 |
+
def user_following(userid: str, count: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 190 |
+
"""
|
| 191 |
+
"Get Instagram user following by Instagram user id."
|
| 192 |
+
|
| 193 |
+
"""
|
| 194 |
+
url = f"https://instagram243.p.rapidapi.com/userfollowing/{userid}/{count}/{end_cursor}"
|
| 195 |
+
querystring = {}
|
| 196 |
+
if end_cursor:
|
| 197 |
+
querystring['end_cursor'] = end_cursor
|
| 198 |
+
|
| 199 |
+
headers = {
|
| 200 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 201 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 206 |
+
try:
|
| 207 |
+
observation = response.json()
|
| 208 |
+
except:
|
| 209 |
+
observation = response.text
|
| 210 |
+
return observation
|
| 211 |
+
|
| 212 |
+
def user_profile_picture(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 213 |
+
"""
|
| 214 |
+
"Get Instagram user profile picture by Instagram username."
|
| 215 |
+
|
| 216 |
+
"""
|
| 217 |
+
url = f"https://instagram243.p.rapidapi.com/userprofilephoto/{username}"
|
| 218 |
+
querystring = {}
|
| 219 |
+
|
| 220 |
+
headers = {
|
| 221 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 222 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 227 |
+
try:
|
| 228 |
+
observation = response.json()
|
| 229 |
+
except:
|
| 230 |
+
observation = response.text
|
| 231 |
+
return observation
|
| 232 |
+
|
| 233 |
+
def user_followers(userid: str, count: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 234 |
+
"""
|
| 235 |
+
"Get Instagram user followers by Instagram user id."
|
| 236 |
+
|
| 237 |
+
"""
|
| 238 |
+
url = f"https://instagram243.p.rapidapi.com/userfollowers/{userid}/{count}/{end_cursor}"
|
| 239 |
+
querystring = {}
|
| 240 |
+
if end_cursor:
|
| 241 |
+
querystring['end_cursor'] = end_cursor
|
| 242 |
+
|
| 243 |
+
headers = {
|
| 244 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 245 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 250 |
+
try:
|
| 251 |
+
observation = response.json()
|
| 252 |
+
except:
|
| 253 |
+
observation = response.text
|
| 254 |
+
return observation
|
| 255 |
+
|
| 256 |
+
def user_tagged_posts(userid: str, count: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 257 |
+
"""
|
| 258 |
+
"Get Instagram user tagged posts by Instagram user id."
|
| 259 |
+
|
| 260 |
+
"""
|
| 261 |
+
url = f"https://instagram243.p.rapidapi.com/usertaggedposts/{userid}/{count}/{end_cursor}"
|
| 262 |
+
querystring = {}
|
| 263 |
+
if end_cursor:
|
| 264 |
+
querystring['end_cursor'] = end_cursor
|
| 265 |
+
|
| 266 |
+
headers = {
|
| 267 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 268 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
|
| 272 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 273 |
+
try:
|
| 274 |
+
observation = response.json()
|
| 275 |
+
except:
|
| 276 |
+
observation = response.text
|
| 277 |
+
return observation
|
| 278 |
+
|
| 279 |
+
def similar_users(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 280 |
+
"""
|
| 281 |
+
"Get similar Instagram users by Instagram user id."
|
| 282 |
+
|
| 283 |
+
"""
|
| 284 |
+
url = f"https://instagram243.p.rapidapi.com/similarusers/{userid}"
|
| 285 |
+
querystring = {}
|
| 286 |
+
|
| 287 |
+
headers = {
|
| 288 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 289 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
|
| 293 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 294 |
+
try:
|
| 295 |
+
observation = response.json()
|
| 296 |
+
except:
|
| 297 |
+
observation = response.text
|
| 298 |
+
return observation
|
| 299 |
+
|
| 300 |
+
def user_reels(count: str, userid: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 301 |
+
"""
|
| 302 |
+
"Get Instagram user reels by Instagram user id."
|
| 303 |
+
|
| 304 |
+
"""
|
| 305 |
+
url = f"https://instagram243.p.rapidapi.com/userreels/{userid}/{count}/{end_cursor}"
|
| 306 |
+
querystring = {}
|
| 307 |
+
if end_cursor:
|
| 308 |
+
querystring['end_cursor'] = end_cursor
|
| 309 |
+
|
| 310 |
+
headers = {
|
| 311 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 312 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
|
| 316 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 317 |
+
try:
|
| 318 |
+
observation = response.json()
|
| 319 |
+
except:
|
| 320 |
+
observation = response.text
|
| 321 |
+
return observation
|
| 322 |
+
|
| 323 |
+
def user_posts(count: str, userid: str, end_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 324 |
+
"""
|
| 325 |
+
"Get Instagram user posts by Instagram user id."
|
| 326 |
+
|
| 327 |
+
"""
|
| 328 |
+
url = f"https://instagram243.p.rapidapi.com/userposts/{userid}/{count}/{end_cursor}"
|
| 329 |
+
querystring = {}
|
| 330 |
+
if end_cursor:
|
| 331 |
+
querystring['end_cursor'] = end_cursor
|
| 332 |
+
|
| 333 |
+
headers = {
|
| 334 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 335 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 336 |
+
}
|
| 337 |
+
|
| 338 |
+
|
| 339 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 340 |
+
try:
|
| 341 |
+
observation = response.json()
|
| 342 |
+
except:
|
| 343 |
+
observation = response.text
|
| 344 |
+
return observation
|
| 345 |
+
|
| 346 |
+
def user_info_by_user_id(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 347 |
+
"""
|
| 348 |
+
"Get Instagram user information by Instagram user id."
|
| 349 |
+
|
| 350 |
+
"""
|
| 351 |
+
url = f"https://instagram243.p.rapidapi.com/usercontact/{userid}"
|
| 352 |
+
querystring = {}
|
| 353 |
+
|
| 354 |
+
headers = {
|
| 355 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 356 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
|
| 360 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 361 |
+
try:
|
| 362 |
+
observation = response.json()
|
| 363 |
+
except:
|
| 364 |
+
observation = response.text
|
| 365 |
+
return observation
|
| 366 |
+
|
| 367 |
+
def user_id(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 368 |
+
"""
|
| 369 |
+
"Get Instagram user id by Instagram username"
|
| 370 |
+
|
| 371 |
+
"""
|
| 372 |
+
url = f"https://instagram243.p.rapidapi.com/userid/{username}"
|
| 373 |
+
querystring = {}
|
| 374 |
+
|
| 375 |
+
headers = {
|
| 376 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 377 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
|
| 381 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 382 |
+
try:
|
| 383 |
+
observation = response.json()
|
| 384 |
+
except:
|
| 385 |
+
observation = response.text
|
| 386 |
+
return observation
|
| 387 |
+
|
| 388 |
+
def user_info_by_username(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 389 |
+
"""
|
| 390 |
+
"Get Instagram user information by Instagram username."
|
| 391 |
+
|
| 392 |
+
"""
|
| 393 |
+
url = f"https://instagram243.p.rapidapi.com/userinfo/{username}"
|
| 394 |
+
querystring = {}
|
| 395 |
+
|
| 396 |
+
headers = {
|
| 397 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 398 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 399 |
+
}
|
| 400 |
+
|
| 401 |
+
|
| 402 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 403 |
+
try:
|
| 404 |
+
observation = response.json()
|
| 405 |
+
except:
|
| 406 |
+
observation = response.text
|
| 407 |
+
return observation
|
| 408 |
+
|
| 409 |
+
def user_search(keyword: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 410 |
+
"""
|
| 411 |
+
"Get Instagram users by keyword."
|
| 412 |
+
|
| 413 |
+
"""
|
| 414 |
+
url = f"https://instagram243.p.rapidapi.com/searchuser/{keyword}"
|
| 415 |
+
querystring = {}
|
| 416 |
+
|
| 417 |
+
headers = {
|
| 418 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 419 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 420 |
+
}
|
| 421 |
+
|
| 422 |
+
|
| 423 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 424 |
+
try:
|
| 425 |
+
observation = response.json()
|
| 426 |
+
except:
|
| 427 |
+
observation = response.text
|
| 428 |
+
return observation
|
| 429 |
+
|
| 430 |
+
def location_search(keyword: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 431 |
+
"""
|
| 432 |
+
"Get Instagram locations by keyword."
|
| 433 |
+
|
| 434 |
+
"""
|
| 435 |
+
url = f"https://instagram243.p.rapidapi.com/searchlocation/{keyword}"
|
| 436 |
+
querystring = {}
|
| 437 |
+
|
| 438 |
+
headers = {
|
| 439 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 440 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 441 |
+
}
|
| 442 |
+
|
| 443 |
+
|
| 444 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 445 |
+
try:
|
| 446 |
+
observation = response.json()
|
| 447 |
+
except:
|
| 448 |
+
observation = response.text
|
| 449 |
+
return observation
|
| 450 |
+
|
| 451 |
+
def search_location(keyword: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 452 |
+
"""
|
| 453 |
+
"Get Instagram locations by keyword."
|
| 454 |
+
|
| 455 |
+
"""
|
| 456 |
+
url = f"https://instagram243.p.rapidapi.com/searchlocation/{keyword}"
|
| 457 |
+
querystring = {}
|
| 458 |
+
|
| 459 |
+
headers = {
|
| 460 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 461 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
|
| 465 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 466 |
+
try:
|
| 467 |
+
observation = response.json()
|
| 468 |
+
except:
|
| 469 |
+
observation = response.text
|
| 470 |
+
return observation
|
| 471 |
+
|
| 472 |
+
def search_hashtag(keyword: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 473 |
+
"""
|
| 474 |
+
"Get Instagram hashtags by keyword."
|
| 475 |
+
|
| 476 |
+
"""
|
| 477 |
+
url = f"https://instagram243.p.rapidapi.com/searchtag/{keyword}"
|
| 478 |
+
querystring = {}
|
| 479 |
+
|
| 480 |
+
headers = {
|
| 481 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 482 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 483 |
+
}
|
| 484 |
+
|
| 485 |
+
|
| 486 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 487 |
+
try:
|
| 488 |
+
observation = response.json()
|
| 489 |
+
except:
|
| 490 |
+
observation = response.text
|
| 491 |
+
return observation
|
| 492 |
+
|
| 493 |
+
def search_user(keyword: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 494 |
+
"""
|
| 495 |
+
"Get Instagram users by keyword."
|
| 496 |
+
|
| 497 |
+
"""
|
| 498 |
+
url = f"https://instagram243.p.rapidapi.com/searchuser/{keyword}"
|
| 499 |
+
querystring = {}
|
| 500 |
+
|
| 501 |
+
headers = {
|
| 502 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 503 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 504 |
+
}
|
| 505 |
+
|
| 506 |
+
|
| 507 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 508 |
+
try:
|
| 509 |
+
observation = response.json()
|
| 510 |
+
except:
|
| 511 |
+
observation = response.text
|
| 512 |
+
return observation
|
| 513 |
+
|
| 514 |
+
def live_broadcast_info(broadcastid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 515 |
+
"""
|
| 516 |
+
"Get Instagram live broadcast info by Instagram broadcas id."
|
| 517 |
+
|
| 518 |
+
"""
|
| 519 |
+
url = f"https://instagram243.p.rapidapi.com/liveinfo/{broadcastid}"
|
| 520 |
+
querystring = {}
|
| 521 |
+
|
| 522 |
+
headers = {
|
| 523 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 524 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 525 |
+
}
|
| 526 |
+
|
| 527 |
+
|
| 528 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 529 |
+
try:
|
| 530 |
+
observation = response.json()
|
| 531 |
+
except:
|
| 532 |
+
observation = response.text
|
| 533 |
+
return observation
|
| 534 |
+
|
| 535 |
+
def music_information(musicid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 536 |
+
"""
|
| 537 |
+
"Get Instagram music information by Instagram audio_cluster_id."
|
| 538 |
+
musicid: audio_cluster_id
|
| 539 |
+
|
| 540 |
+
"""
|
| 541 |
+
url = f"https://instagram243.p.rapidapi.com/musicinfo/{musicid}"
|
| 542 |
+
querystring = {}
|
| 543 |
+
|
| 544 |
+
headers = {
|
| 545 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 546 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 547 |
+
}
|
| 548 |
+
|
| 549 |
+
|
| 550 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 551 |
+
try:
|
| 552 |
+
observation = response.json()
|
| 553 |
+
except:
|
| 554 |
+
observation = response.text
|
| 555 |
+
return observation
|
| 556 |
+
|
| 557 |
+
def location_information(locationid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 558 |
+
"""
|
| 559 |
+
"Get Instagram location information by Instagram location id."
|
| 560 |
+
|
| 561 |
+
"""
|
| 562 |
+
url = f"https://instagram243.p.rapidapi.com/locationinfo/{locationid}"
|
| 563 |
+
querystring = {}
|
| 564 |
+
|
| 565 |
+
headers = {
|
| 566 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 567 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 568 |
+
}
|
| 569 |
+
|
| 570 |
+
|
| 571 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 572 |
+
try:
|
| 573 |
+
observation = response.json()
|
| 574 |
+
except:
|
| 575 |
+
observation = response.text
|
| 576 |
+
return observation
|
| 577 |
+
|
| 578 |
+
def user_highlights_list(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 579 |
+
"""
|
| 580 |
+
"Get Instagram user highlights list by Instagram user id."
|
| 581 |
+
|
| 582 |
+
"""
|
| 583 |
+
url = f"https://instagram243.p.rapidapi.com/userhighlights/{userid}"
|
| 584 |
+
querystring = {}
|
| 585 |
+
|
| 586 |
+
headers = {
|
| 587 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 588 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 589 |
+
}
|
| 590 |
+
|
| 591 |
+
|
| 592 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 593 |
+
try:
|
| 594 |
+
observation = response.json()
|
| 595 |
+
except:
|
| 596 |
+
observation = response.text
|
| 597 |
+
return observation
|
| 598 |
+
|
| 599 |
+
def user_live_broadcast(userid: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 600 |
+
"""
|
| 601 |
+
"Get Instagram user live broadcast by Instagram user id."
|
| 602 |
+
|
| 603 |
+
"""
|
| 604 |
+
url = f"https://instagram243.p.rapidapi.com/userlive/{userid}"
|
| 605 |
+
querystring = {}
|
| 606 |
+
|
| 607 |
+
headers = {
|
| 608 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 609 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 610 |
+
}
|
| 611 |
+
|
| 612 |
+
|
| 613 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 614 |
+
try:
|
| 615 |
+
observation = response.json()
|
| 616 |
+
except:
|
| 617 |
+
observation = response.text
|
| 618 |
+
return observation
|
| 619 |
+
|
| 620 |
+
def check_shortcode(shortcode: str, password: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 621 |
+
"""
|
| 622 |
+
"Private"
|
| 623 |
+
|
| 624 |
+
"""
|
| 625 |
+
url = f"https://instagram243.p.rapidapi.com/checkshortcode/{shortcode}/{password}"
|
| 626 |
+
querystring = {}
|
| 627 |
+
|
| 628 |
+
headers = {
|
| 629 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 630 |
+
"X-RapidAPI-Host": "instagram243.p.rapidapi.com"
|
| 631 |
+
}
|
| 632 |
+
|
| 633 |
+
|
| 634 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 635 |
+
try:
|
| 636 |
+
observation = response.json()
|
| 637 |
+
except:
|
| 638 |
+
observation = response.text
|
| 639 |
+
return observation
|
| 640 |
+
|
toolbench/toolenv/tools/Social/instagram_v6.json
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_5a3cd51b-fee6-45c8-9130-771ba1df2038",
|
| 3 |
+
"tool_description": "instagram api",
|
| 4 |
+
"home_url": "https://rapidapi.com/yuananf/api/instagram28/",
|
| 5 |
+
"name": "Instagram_v6",
|
| 6 |
+
"title": "Instagram",
|
| 7 |
+
"pricing": "FREEMIUM",
|
| 8 |
+
"tool_name": "Instagram_v6",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 3646,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 9.9,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "instagram28.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "MediaInfo_v2",
|
| 20 |
+
"url": "https://instagram28.p.rapidapi.com/media_info_v2",
|
| 21 |
+
"description": "get media info v2",
|
| 22 |
+
"method": "GET",
|
| 23 |
+
"required_parameters": [
|
| 24 |
+
{
|
| 25 |
+
"name": "short_code",
|
| 26 |
+
"type": "STRING",
|
| 27 |
+
"description": "",
|
| 28 |
+
"default": "CA_ifcxMjFR"
|
| 29 |
+
}
|
| 30 |
+
],
|
| 31 |
+
"optional_parameters": [],
|
| 32 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/media_info_v2\"\nquerystring = {\"short_code\": \"CA_ifcxMjFR\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 33 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/media_info_v2\"\nquerystring = {\"short_code\": \"CA_ifcxMjFR\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 34 |
+
"test_endpoint": "",
|
| 35 |
+
"statuscode": 200,
|
| 36 |
+
"schema": {}
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"name": "UserInfo",
|
| 40 |
+
"url": "https://instagram28.p.rapidapi.com/user_info",
|
| 41 |
+
"description": "Get instagram user info by user name, response with old format. result -> user.",
|
| 42 |
+
"method": "GET",
|
| 43 |
+
"required_parameters": [
|
| 44 |
+
{
|
| 45 |
+
"name": "user_name",
|
| 46 |
+
"type": "STRING",
|
| 47 |
+
"description": "",
|
| 48 |
+
"default": "instagram"
|
| 49 |
+
}
|
| 50 |
+
],
|
| 51 |
+
"optional_parameters": [],
|
| 52 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/user_info\"\nquerystring = {\"user_name\": \"instagram\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 53 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/user_info\"\nquerystring = {\"user_name\": \"instagram\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 54 |
+
"test_endpoint": "",
|
| 55 |
+
"statuscode": 200,
|
| 56 |
+
"schema": {}
|
| 57 |
+
},
|
| 58 |
+
{
|
| 59 |
+
"name": "GetUserNameByUserId",
|
| 60 |
+
"url": "https://instagram28.p.rapidapi.com/username",
|
| 61 |
+
"description": "get username by user id",
|
| 62 |
+
"method": "GET",
|
| 63 |
+
"required_parameters": [
|
| 64 |
+
{
|
| 65 |
+
"name": "user_id",
|
| 66 |
+
"type": "NUMBER",
|
| 67 |
+
"description": "",
|
| 68 |
+
"default": "25025320"
|
| 69 |
+
}
|
| 70 |
+
],
|
| 71 |
+
"optional_parameters": [],
|
| 72 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/username\"\nquerystring = {\"user_id\": \"25025320\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 73 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/username\"\nquerystring = {\"user_id\": \"25025320\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 74 |
+
"test_endpoint": "",
|
| 75 |
+
"statuscode": 200,
|
| 76 |
+
"schema": {}
|
| 77 |
+
},
|
| 78 |
+
{
|
| 79 |
+
"name": "HashTagMedias",
|
| 80 |
+
"url": "https://instagram28.p.rapidapi.com/hash_tag_medias",
|
| 81 |
+
"description": "Get hashtag medias",
|
| 82 |
+
"method": "GET",
|
| 83 |
+
"required_parameters": [
|
| 84 |
+
{
|
| 85 |
+
"name": "hash_tag",
|
| 86 |
+
"type": "STRING",
|
| 87 |
+
"description": "",
|
| 88 |
+
"default": "cat"
|
| 89 |
+
}
|
| 90 |
+
],
|
| 91 |
+
"optional_parameters": [
|
| 92 |
+
{
|
| 93 |
+
"name": "next_cursor",
|
| 94 |
+
"type": "STRING",
|
| 95 |
+
"description": "",
|
| 96 |
+
"default": ""
|
| 97 |
+
}
|
| 98 |
+
],
|
| 99 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/hash_tag_medias\"\nquerystring = {\"next_cursor\": \"\", \"hash_tag\": \"cat\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 100 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/hash_tag_medias\"\nquerystring = {\"next_cursor\": \"\", \"hash_tag\": \"cat\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 101 |
+
"test_endpoint": "",
|
| 102 |
+
"statuscode": 200,
|
| 103 |
+
"schema": {}
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"name": "Medias",
|
| 107 |
+
"url": "https://instagram28.p.rapidapi.com/medias",
|
| 108 |
+
"description": "Get someone's medias, batch_size range from 1 to 50",
|
| 109 |
+
"method": "GET",
|
| 110 |
+
"required_parameters": [
|
| 111 |
+
{
|
| 112 |
+
"name": "user_id",
|
| 113 |
+
"type": "STRING",
|
| 114 |
+
"description": "",
|
| 115 |
+
"default": "25025320"
|
| 116 |
+
}
|
| 117 |
+
],
|
| 118 |
+
"optional_parameters": [
|
| 119 |
+
{
|
| 120 |
+
"name": "batch_size",
|
| 121 |
+
"type": "NUMBER",
|
| 122 |
+
"description": "Range from 1 to 50.",
|
| 123 |
+
"default": "20"
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"name": "next_cursor",
|
| 127 |
+
"type": "STRING",
|
| 128 |
+
"description": "",
|
| 129 |
+
"default": ""
|
| 130 |
+
}
|
| 131 |
+
],
|
| 132 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/medias\"\nquerystring = {\"batch_size\": \"20\", \"user_id\": \"25025320\", \"next_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 133 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/medias\"\nquerystring = {\"batch_size\": \"20\", \"user_id\": \"25025320\", \"next_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 134 |
+
"test_endpoint": "",
|
| 135 |
+
"statuscode": 200,
|
| 136 |
+
"schema": {}
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"name": "MediaInfo",
|
| 140 |
+
"url": "https://instagram28.p.rapidapi.com/media_info",
|
| 141 |
+
"description": "get media info",
|
| 142 |
+
"method": "GET",
|
| 143 |
+
"required_parameters": [
|
| 144 |
+
{
|
| 145 |
+
"name": "short_code",
|
| 146 |
+
"type": "STRING",
|
| 147 |
+
"description": "",
|
| 148 |
+
"default": "CA_ifcxMjFR"
|
| 149 |
+
}
|
| 150 |
+
],
|
| 151 |
+
"optional_parameters": [],
|
| 152 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/media_info\"\nquerystring = {\"short_code\": \"CA_ifcxMjFR\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 153 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/media_info\"\nquerystring = {\"short_code\": \"CA_ifcxMjFR\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 154 |
+
"test_endpoint": "",
|
| 155 |
+
"statuscode": 200,
|
| 156 |
+
"schema": {}
|
| 157 |
+
},
|
| 158 |
+
{
|
| 159 |
+
"name": "MediaLikers",
|
| 160 |
+
"url": "https://instagram28.p.rapidapi.com/media_likers",
|
| 161 |
+
"description": "Get one media's likers, batch_size range from 1 to 50.",
|
| 162 |
+
"method": "GET",
|
| 163 |
+
"required_parameters": [
|
| 164 |
+
{
|
| 165 |
+
"name": "short_code",
|
| 166 |
+
"type": "STRING",
|
| 167 |
+
"description": "",
|
| 168 |
+
"default": "CB_B4z_s-0r"
|
| 169 |
+
}
|
| 170 |
+
],
|
| 171 |
+
"optional_parameters": [
|
| 172 |
+
{
|
| 173 |
+
"name": "next_cursor",
|
| 174 |
+
"type": "STRING",
|
| 175 |
+
"description": "",
|
| 176 |
+
"default": ""
|
| 177 |
+
},
|
| 178 |
+
{
|
| 179 |
+
"name": "batch_size",
|
| 180 |
+
"type": "NUMBER",
|
| 181 |
+
"description": "Range from 1 to 50.",
|
| 182 |
+
"default": "20"
|
| 183 |
+
}
|
| 184 |
+
],
|
| 185 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/media_likers\"\nquerystring = {\"next_cursor\": \"\", \"short_code\": \"CB_B4z_s-0r\", \"batch_size\": \"20\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 186 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/media_likers\"\nquerystring = {\"next_cursor\": \"\", \"short_code\": \"CB_B4z_s-0r\", \"batch_size\": \"20\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 187 |
+
"test_endpoint": "",
|
| 188 |
+
"statuscode": 200,
|
| 189 |
+
"schema": {}
|
| 190 |
+
},
|
| 191 |
+
{
|
| 192 |
+
"name": "GetUserStories",
|
| 193 |
+
"url": "https://instagram28.p.rapidapi.com/stories",
|
| 194 |
+
"description": "get stories by user id",
|
| 195 |
+
"method": "GET",
|
| 196 |
+
"required_parameters": [
|
| 197 |
+
{
|
| 198 |
+
"name": "user_id",
|
| 199 |
+
"type": "NUMBER",
|
| 200 |
+
"description": "",
|
| 201 |
+
"default": "1154485247"
|
| 202 |
+
}
|
| 203 |
+
],
|
| 204 |
+
"optional_parameters": [],
|
| 205 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/stories\"\nquerystring = {\"user_id\": \"1154485247\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 206 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/stories\"\nquerystring = {\"user_id\": \"1154485247\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 207 |
+
"test_endpoint": "",
|
| 208 |
+
"statuscode": 200,
|
| 209 |
+
"schema": {}
|
| 210 |
+
},
|
| 211 |
+
{
|
| 212 |
+
"name": "Following",
|
| 213 |
+
"url": "https://instagram28.p.rapidapi.com/following",
|
| 214 |
+
"description": "get someone's following",
|
| 215 |
+
"method": "GET",
|
| 216 |
+
"required_parameters": [
|
| 217 |
+
{
|
| 218 |
+
"name": "user_id",
|
| 219 |
+
"type": "STRING",
|
| 220 |
+
"description": "",
|
| 221 |
+
"default": "25025320"
|
| 222 |
+
}
|
| 223 |
+
],
|
| 224 |
+
"optional_parameters": [
|
| 225 |
+
{
|
| 226 |
+
"name": "next_cursor",
|
| 227 |
+
"type": "STRING",
|
| 228 |
+
"description": "",
|
| 229 |
+
"default": ""
|
| 230 |
+
},
|
| 231 |
+
{
|
| 232 |
+
"name": "batch_size",
|
| 233 |
+
"type": "NUMBER",
|
| 234 |
+
"description": "Custom value can only be set by paying user.",
|
| 235 |
+
"default": "20"
|
| 236 |
+
}
|
| 237 |
+
],
|
| 238 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/following\"\nquerystring = {\"next_cursor\": \"\", \"batch_size\": \"20\", \"user_id\": \"25025320\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 239 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/following\"\nquerystring = {\"next_cursor\": \"\", \"batch_size\": \"20\", \"user_id\": \"25025320\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 240 |
+
"test_endpoint": "",
|
| 241 |
+
"statuscode": 200,
|
| 242 |
+
"schema": {}
|
| 243 |
+
},
|
| 244 |
+
{
|
| 245 |
+
"name": "Followers",
|
| 246 |
+
"url": "https://instagram28.p.rapidapi.com/followers",
|
| 247 |
+
"description": "get someone's followers",
|
| 248 |
+
"method": "GET",
|
| 249 |
+
"required_parameters": [
|
| 250 |
+
{
|
| 251 |
+
"name": "user_id",
|
| 252 |
+
"type": "STRING",
|
| 253 |
+
"description": "",
|
| 254 |
+
"default": "25025320"
|
| 255 |
+
}
|
| 256 |
+
],
|
| 257 |
+
"optional_parameters": [
|
| 258 |
+
{
|
| 259 |
+
"name": "batch_size",
|
| 260 |
+
"type": "NUMBER",
|
| 261 |
+
"description": "Custom value can only be set by paying user.",
|
| 262 |
+
"default": "20"
|
| 263 |
+
},
|
| 264 |
+
{
|
| 265 |
+
"name": "next_cursor",
|
| 266 |
+
"type": "STRING",
|
| 267 |
+
"description": "",
|
| 268 |
+
"default": ""
|
| 269 |
+
}
|
| 270 |
+
],
|
| 271 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/followers\"\nquerystring = {\"batch_size\": \"20\", \"next_cursor\": \"\", \"user_id\": \"25025320\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 272 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/followers\"\nquerystring = {\"batch_size\": \"20\", \"next_cursor\": \"\", \"user_id\": \"25025320\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 273 |
+
"test_endpoint": "",
|
| 274 |
+
"statuscode": 200,
|
| 275 |
+
"schema": {}
|
| 276 |
+
},
|
| 277 |
+
{
|
| 278 |
+
"name": "SearchFollowers",
|
| 279 |
+
"url": "https://instagram28.p.rapidapi.com/search_followers",
|
| 280 |
+
"description": "search someone's followers",
|
| 281 |
+
"method": "GET",
|
| 282 |
+
"required_parameters": [
|
| 283 |
+
{
|
| 284 |
+
"name": "user_id",
|
| 285 |
+
"type": "STRING",
|
| 286 |
+
"description": "",
|
| 287 |
+
"default": "25025320"
|
| 288 |
+
},
|
| 289 |
+
{
|
| 290 |
+
"name": "query",
|
| 291 |
+
"type": "STRING",
|
| 292 |
+
"description": "",
|
| 293 |
+
"default": "fake"
|
| 294 |
+
}
|
| 295 |
+
],
|
| 296 |
+
"optional_parameters": [],
|
| 297 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/search_followers\"\nquerystring = {\"user_id\": \"25025320\", \"query\": \"fake\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 298 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/search_followers\"\nquerystring = {\"user_id\": \"25025320\", \"query\": \"fake\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 299 |
+
"test_endpoint": "",
|
| 300 |
+
"statuscode": 200,
|
| 301 |
+
"schema": {}
|
| 302 |
+
},
|
| 303 |
+
{
|
| 304 |
+
"name": "SearchFollowing",
|
| 305 |
+
"url": "https://instagram28.p.rapidapi.com/search_following",
|
| 306 |
+
"description": "search someone's following",
|
| 307 |
+
"method": "GET",
|
| 308 |
+
"required_parameters": [
|
| 309 |
+
{
|
| 310 |
+
"name": "user_id",
|
| 311 |
+
"type": "STRING",
|
| 312 |
+
"description": "",
|
| 313 |
+
"default": "25025320"
|
| 314 |
+
},
|
| 315 |
+
{
|
| 316 |
+
"name": "query",
|
| 317 |
+
"type": "STRING",
|
| 318 |
+
"description": "",
|
| 319 |
+
"default": "tarun"
|
| 320 |
+
}
|
| 321 |
+
],
|
| 322 |
+
"optional_parameters": [],
|
| 323 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/search_following\"\nquerystring = {\"user_id\": \"25025320\", \"query\": \"tarun\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 324 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/search_following\"\nquerystring = {\"user_id\": \"25025320\", \"query\": \"tarun\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 325 |
+
"test_endpoint": "",
|
| 326 |
+
"statuscode": 200,
|
| 327 |
+
"schema": {}
|
| 328 |
+
},
|
| 329 |
+
{
|
| 330 |
+
"name": "GetSuggestedUser",
|
| 331 |
+
"url": "https://instagram28.p.rapidapi.com/suggested_user",
|
| 332 |
+
"description": "get suggested user by user id",
|
| 333 |
+
"method": "GET",
|
| 334 |
+
"required_parameters": [
|
| 335 |
+
{
|
| 336 |
+
"name": "user_id",
|
| 337 |
+
"type": "NUMBER",
|
| 338 |
+
"description": "",
|
| 339 |
+
"default": "25025320"
|
| 340 |
+
}
|
| 341 |
+
],
|
| 342 |
+
"optional_parameters": [],
|
| 343 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/suggested_user\"\nquerystring = {\"user_id\": \"25025320\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 344 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/suggested_user\"\nquerystring = {\"user_id\": \"25025320\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 345 |
+
"test_endpoint": "",
|
| 346 |
+
"statuscode": 200,
|
| 347 |
+
"schema": {}
|
| 348 |
+
},
|
| 349 |
+
{
|
| 350 |
+
"name": "MediaComments",
|
| 351 |
+
"url": "https://instagram28.p.rapidapi.com/media_comments",
|
| 352 |
+
"description": "Get one media's comments, batch_size range from 1 to 50.",
|
| 353 |
+
"method": "GET",
|
| 354 |
+
"required_parameters": [
|
| 355 |
+
{
|
| 356 |
+
"name": "short_code",
|
| 357 |
+
"type": "STRING",
|
| 358 |
+
"description": "",
|
| 359 |
+
"default": "CB_B4z_s-0r"
|
| 360 |
+
}
|
| 361 |
+
],
|
| 362 |
+
"optional_parameters": [
|
| 363 |
+
{
|
| 364 |
+
"name": "batch_size",
|
| 365 |
+
"type": "STRING",
|
| 366 |
+
"description": "Range from 1 to 50.",
|
| 367 |
+
"default": "20"
|
| 368 |
+
},
|
| 369 |
+
{
|
| 370 |
+
"name": "next_cursor",
|
| 371 |
+
"type": "STRING",
|
| 372 |
+
"description": "",
|
| 373 |
+
"default": ""
|
| 374 |
+
}
|
| 375 |
+
],
|
| 376 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/media_comments\"\nquerystring = {\"short_code\": \"CB_B4z_s-0r\", \"batch_size\": \"20\", \"next_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 377 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/media_comments\"\nquerystring = {\"short_code\": \"CB_B4z_s-0r\", \"batch_size\": \"20\", \"next_cursor\": \"\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 378 |
+
"test_endpoint": "",
|
| 379 |
+
"statuscode": 200,
|
| 380 |
+
"schema": {}
|
| 381 |
+
},
|
| 382 |
+
{
|
| 383 |
+
"name": "GetUserNameByUserId_v2",
|
| 384 |
+
"url": "https://instagram28.p.rapidapi.com/username_v2",
|
| 385 |
+
"description": "get username by user id",
|
| 386 |
+
"method": "GET",
|
| 387 |
+
"required_parameters": [
|
| 388 |
+
{
|
| 389 |
+
"name": "user_id",
|
| 390 |
+
"type": "NUMBER",
|
| 391 |
+
"description": "",
|
| 392 |
+
"default": "25025320"
|
| 393 |
+
}
|
| 394 |
+
],
|
| 395 |
+
"optional_parameters": [],
|
| 396 |
+
"code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/username_v2\"\nquerystring = {\"user_id\": \"25025320\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 397 |
+
"convert_code": "import requests\n\nurl = \"https://instagram28.p.rapidapi.com/username_v2\"\nquerystring = {\"user_id\": \"25025320\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram28.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 398 |
+
"test_endpoint": "",
|
| 399 |
+
"statuscode": 200,
|
| 400 |
+
"schema": {}
|
| 401 |
+
}
|
| 402 |
+
],
|
| 403 |
+
"standardized_name": "instagram_v6"
|
| 404 |
+
}
|
toolbench/toolenv/tools/Social/instagram_v6/api.py
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 mediainfo_v2(short_code: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"get media info v2"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram28.p.rapidapi.com/media_info_v2"
|
| 15 |
+
querystring = {'short_code': short_code, }
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram28.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 userinfo(user_name: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"Get instagram user info by user name, response with old format. result -> user."
|
| 33 |
+
|
| 34 |
+
"""
|
| 35 |
+
url = f"https://instagram28.p.rapidapi.com/user_info"
|
| 36 |
+
querystring = {'user_name': user_name, }
|
| 37 |
+
|
| 38 |
+
headers = {
|
| 39 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 40 |
+
"X-RapidAPI-Host": "instagram28.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 getusernamebyuserid(user_id: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 52 |
+
"""
|
| 53 |
+
"get username by user id"
|
| 54 |
+
|
| 55 |
+
"""
|
| 56 |
+
url = f"https://instagram28.p.rapidapi.com/username"
|
| 57 |
+
querystring = {'user_id': user_id, }
|
| 58 |
+
|
| 59 |
+
headers = {
|
| 60 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 61 |
+
"X-RapidAPI-Host": "instagram28.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 hashtagmedias(hash_tag: str, next_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 73 |
+
"""
|
| 74 |
+
"Get hashtag medias"
|
| 75 |
+
|
| 76 |
+
"""
|
| 77 |
+
url = f"https://instagram28.p.rapidapi.com/hash_tag_medias"
|
| 78 |
+
querystring = {'hash_tag': hash_tag, }
|
| 79 |
+
if next_cursor:
|
| 80 |
+
querystring['next_cursor'] = next_cursor
|
| 81 |
+
|
| 82 |
+
headers = {
|
| 83 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 84 |
+
"X-RapidAPI-Host": "instagram28.p.rapidapi.com"
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 89 |
+
try:
|
| 90 |
+
observation = response.json()
|
| 91 |
+
except:
|
| 92 |
+
observation = response.text
|
| 93 |
+
return observation
|
| 94 |
+
|
| 95 |
+
def medias(user_id: str, batch_size: int=20, next_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 96 |
+
"""
|
| 97 |
+
"Get someone's medias, batch_size range from 1 to 50"
|
| 98 |
+
batch_size: Range from 1 to 50.
|
| 99 |
+
|
| 100 |
+
"""
|
| 101 |
+
url = f"https://instagram28.p.rapidapi.com/medias"
|
| 102 |
+
querystring = {'user_id': user_id, }
|
| 103 |
+
if batch_size:
|
| 104 |
+
querystring['batch_size'] = batch_size
|
| 105 |
+
if next_cursor:
|
| 106 |
+
querystring['next_cursor'] = next_cursor
|
| 107 |
+
|
| 108 |
+
headers = {
|
| 109 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 110 |
+
"X-RapidAPI-Host": "instagram28.p.rapidapi.com"
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 115 |
+
try:
|
| 116 |
+
observation = response.json()
|
| 117 |
+
except:
|
| 118 |
+
observation = response.text
|
| 119 |
+
return observation
|
| 120 |
+
|
| 121 |
+
def mediainfo(short_code: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 122 |
+
"""
|
| 123 |
+
"get media info"
|
| 124 |
+
|
| 125 |
+
"""
|
| 126 |
+
url = f"https://instagram28.p.rapidapi.com/media_info"
|
| 127 |
+
querystring = {'short_code': short_code, }
|
| 128 |
+
|
| 129 |
+
headers = {
|
| 130 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 131 |
+
"X-RapidAPI-Host": "instagram28.p.rapidapi.com"
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 136 |
+
try:
|
| 137 |
+
observation = response.json()
|
| 138 |
+
except:
|
| 139 |
+
observation = response.text
|
| 140 |
+
return observation
|
| 141 |
+
|
| 142 |
+
def medialikers(short_code: str, next_cursor: str=None, batch_size: int=20, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 143 |
+
"""
|
| 144 |
+
"Get one media's likers, batch_size range from 1 to 50."
|
| 145 |
+
batch_size: Range from 1 to 50.
|
| 146 |
+
|
| 147 |
+
"""
|
| 148 |
+
url = f"https://instagram28.p.rapidapi.com/media_likers"
|
| 149 |
+
querystring = {'short_code': short_code, }
|
| 150 |
+
if next_cursor:
|
| 151 |
+
querystring['next_cursor'] = next_cursor
|
| 152 |
+
if batch_size:
|
| 153 |
+
querystring['batch_size'] = batch_size
|
| 154 |
+
|
| 155 |
+
headers = {
|
| 156 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 157 |
+
"X-RapidAPI-Host": "instagram28.p.rapidapi.com"
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 162 |
+
try:
|
| 163 |
+
observation = response.json()
|
| 164 |
+
except:
|
| 165 |
+
observation = response.text
|
| 166 |
+
return observation
|
| 167 |
+
|
| 168 |
+
def getuserstories(user_id: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 169 |
+
"""
|
| 170 |
+
"get stories by user id"
|
| 171 |
+
|
| 172 |
+
"""
|
| 173 |
+
url = f"https://instagram28.p.rapidapi.com/stories"
|
| 174 |
+
querystring = {'user_id': user_id, }
|
| 175 |
+
|
| 176 |
+
headers = {
|
| 177 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 178 |
+
"X-RapidAPI-Host": "instagram28.p.rapidapi.com"
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 183 |
+
try:
|
| 184 |
+
observation = response.json()
|
| 185 |
+
except:
|
| 186 |
+
observation = response.text
|
| 187 |
+
return observation
|
| 188 |
+
|
| 189 |
+
def following(user_id: str, next_cursor: str=None, batch_size: int=20, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 190 |
+
"""
|
| 191 |
+
"get someone's following"
|
| 192 |
+
batch_size: Custom value can only be set by paying user.
|
| 193 |
+
|
| 194 |
+
"""
|
| 195 |
+
url = f"https://instagram28.p.rapidapi.com/following"
|
| 196 |
+
querystring = {'user_id': user_id, }
|
| 197 |
+
if next_cursor:
|
| 198 |
+
querystring['next_cursor'] = next_cursor
|
| 199 |
+
if batch_size:
|
| 200 |
+
querystring['batch_size'] = batch_size
|
| 201 |
+
|
| 202 |
+
headers = {
|
| 203 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 204 |
+
"X-RapidAPI-Host": "instagram28.p.rapidapi.com"
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
|
| 208 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 209 |
+
try:
|
| 210 |
+
observation = response.json()
|
| 211 |
+
except:
|
| 212 |
+
observation = response.text
|
| 213 |
+
return observation
|
| 214 |
+
|
| 215 |
+
def followers(user_id: str, batch_size: int=20, next_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 216 |
+
"""
|
| 217 |
+
"get someone's followers"
|
| 218 |
+
batch_size: Custom value can only be set by paying user.
|
| 219 |
+
|
| 220 |
+
"""
|
| 221 |
+
url = f"https://instagram28.p.rapidapi.com/followers"
|
| 222 |
+
querystring = {'user_id': user_id, }
|
| 223 |
+
if batch_size:
|
| 224 |
+
querystring['batch_size'] = batch_size
|
| 225 |
+
if next_cursor:
|
| 226 |
+
querystring['next_cursor'] = next_cursor
|
| 227 |
+
|
| 228 |
+
headers = {
|
| 229 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 230 |
+
"X-RapidAPI-Host": "instagram28.p.rapidapi.com"
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 235 |
+
try:
|
| 236 |
+
observation = response.json()
|
| 237 |
+
except:
|
| 238 |
+
observation = response.text
|
| 239 |
+
return observation
|
| 240 |
+
|
| 241 |
+
def searchfollowers(user_id: str, query: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 242 |
+
"""
|
| 243 |
+
"search someone's followers"
|
| 244 |
+
|
| 245 |
+
"""
|
| 246 |
+
url = f"https://instagram28.p.rapidapi.com/search_followers"
|
| 247 |
+
querystring = {'user_id': user_id, 'query': query, }
|
| 248 |
+
|
| 249 |
+
headers = {
|
| 250 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 251 |
+
"X-RapidAPI-Host": "instagram28.p.rapidapi.com"
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
|
| 255 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 256 |
+
try:
|
| 257 |
+
observation = response.json()
|
| 258 |
+
except:
|
| 259 |
+
observation = response.text
|
| 260 |
+
return observation
|
| 261 |
+
|
| 262 |
+
def searchfollowing(user_id: str, query: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 263 |
+
"""
|
| 264 |
+
"search someone's following"
|
| 265 |
+
|
| 266 |
+
"""
|
| 267 |
+
url = f"https://instagram28.p.rapidapi.com/search_following"
|
| 268 |
+
querystring = {'user_id': user_id, 'query': query, }
|
| 269 |
+
|
| 270 |
+
headers = {
|
| 271 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 272 |
+
"X-RapidAPI-Host": "instagram28.p.rapidapi.com"
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
|
| 276 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 277 |
+
try:
|
| 278 |
+
observation = response.json()
|
| 279 |
+
except:
|
| 280 |
+
observation = response.text
|
| 281 |
+
return observation
|
| 282 |
+
|
| 283 |
+
def getsuggesteduser(user_id: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 284 |
+
"""
|
| 285 |
+
"get suggested user by user id"
|
| 286 |
+
|
| 287 |
+
"""
|
| 288 |
+
url = f"https://instagram28.p.rapidapi.com/suggested_user"
|
| 289 |
+
querystring = {'user_id': user_id, }
|
| 290 |
+
|
| 291 |
+
headers = {
|
| 292 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 293 |
+
"X-RapidAPI-Host": "instagram28.p.rapidapi.com"
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
|
| 297 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 298 |
+
try:
|
| 299 |
+
observation = response.json()
|
| 300 |
+
except:
|
| 301 |
+
observation = response.text
|
| 302 |
+
return observation
|
| 303 |
+
|
| 304 |
+
def mediacomments(short_code: str, batch_size: str='20', next_cursor: str=None, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 305 |
+
"""
|
| 306 |
+
"Get one media's comments, batch_size range from 1 to 50."
|
| 307 |
+
batch_size: Range from 1 to 50.
|
| 308 |
+
|
| 309 |
+
"""
|
| 310 |
+
url = f"https://instagram28.p.rapidapi.com/media_comments"
|
| 311 |
+
querystring = {'short_code': short_code, }
|
| 312 |
+
if batch_size:
|
| 313 |
+
querystring['batch_size'] = batch_size
|
| 314 |
+
if next_cursor:
|
| 315 |
+
querystring['next_cursor'] = next_cursor
|
| 316 |
+
|
| 317 |
+
headers = {
|
| 318 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 319 |
+
"X-RapidAPI-Host": "instagram28.p.rapidapi.com"
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
|
| 323 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 324 |
+
try:
|
| 325 |
+
observation = response.json()
|
| 326 |
+
except:
|
| 327 |
+
observation = response.text
|
| 328 |
+
return observation
|
| 329 |
+
|
| 330 |
+
def getusernamebyuserid_v2(user_id: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 331 |
+
"""
|
| 332 |
+
"get username by user id"
|
| 333 |
+
|
| 334 |
+
"""
|
| 335 |
+
url = f"https://instagram28.p.rapidapi.com/username_v2"
|
| 336 |
+
querystring = {'user_id': user_id, }
|
| 337 |
+
|
| 338 |
+
headers = {
|
| 339 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 340 |
+
"X-RapidAPI-Host": "instagram28.p.rapidapi.com"
|
| 341 |
+
}
|
| 342 |
+
|
| 343 |
+
|
| 344 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 345 |
+
try:
|
| 346 |
+
observation = response.json()
|
| 347 |
+
except:
|
| 348 |
+
observation = response.text
|
| 349 |
+
return observation
|
| 350 |
+
|
toolbench/toolenv/tools/Social/instagram_v7.json
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"product_id": "api_f39a5eb7-a5cb-4189-b579-dfdcdb6ca314",
|
| 3 |
+
"tool_description": "Get information from Instagram reliably",
|
| 4 |
+
"home_url": "https://rapidapi.com/netogami/api/instagram174/",
|
| 5 |
+
"name": "Instagram_v7",
|
| 6 |
+
"title": "Instagram",
|
| 7 |
+
"pricing": "FREE",
|
| 8 |
+
"tool_name": "Instagram_v7",
|
| 9 |
+
"score": {
|
| 10 |
+
"avgServiceLevel": 100,
|
| 11 |
+
"avgLatency": 1729,
|
| 12 |
+
"avgSuccessRate": 100,
|
| 13 |
+
"popularityScore": 9.8,
|
| 14 |
+
"__typename": "Score"
|
| 15 |
+
},
|
| 16 |
+
"host": "instagram174.p.rapidapi.com",
|
| 17 |
+
"api_list": [
|
| 18 |
+
{
|
| 19 |
+
"name": "Get user id from username",
|
| 20 |
+
"url": "https://instagram174.p.rapidapi.com/api/v1/user/instagram/id",
|
| 21 |
+
"description": "Finds user id by username",
|
| 22 |
+
"method": "GET",
|
| 23 |
+
"required_parameters": [
|
| 24 |
+
{
|
| 25 |
+
"name": "username",
|
| 26 |
+
"type": "string",
|
| 27 |
+
"description": "",
|
| 28 |
+
"default": "instagram"
|
| 29 |
+
}
|
| 30 |
+
],
|
| 31 |
+
"optional_parameters": [],
|
| 32 |
+
"code": "import requests\n\nurl = \"https://instagram174.p.rapidapi.com/api/v1/user/instagram/id\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram174.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 33 |
+
"convert_code": "import requests\n\nurl = \"https://instagram174.p.rapidapi.com/api/v1/user/{username}/id\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram174.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 34 |
+
"test_endpoint": ""
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"name": "Get media info",
|
| 38 |
+
"url": "https://instagram174.p.rapidapi.com/api/v1/media/2789566164107201469_25025320/info",
|
| 39 |
+
"description": "Get information about a media by providing the media id.",
|
| 40 |
+
"method": "GET",
|
| 41 |
+
"required_parameters": [
|
| 42 |
+
{
|
| 43 |
+
"name": "id",
|
| 44 |
+
"type": "string",
|
| 45 |
+
"description": "",
|
| 46 |
+
"default": "2789566164107201469_25025320"
|
| 47 |
+
}
|
| 48 |
+
],
|
| 49 |
+
"optional_parameters": [],
|
| 50 |
+
"code": "import requests\n\nurl = \"https://instagram174.p.rapidapi.com/api/v1/media/2789566164107201469_25025320/info\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram174.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 51 |
+
"convert_code": "import requests\n\nurl = \"https://instagram174.p.rapidapi.com/api/v1/media/{is_id}/info\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram174.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 52 |
+
"test_endpoint": ""
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
"name": "Get media id from data",
|
| 56 |
+
"url": "https://instagram174.p.rapidapi.com/api/v1/media/https://www.instagram.com/p/CZ7Ma5sNdif//id",
|
| 57 |
+
"description": "Get the id of a media from some data like a link.",
|
| 58 |
+
"method": "GET",
|
| 59 |
+
"required_parameters": [
|
| 60 |
+
{
|
| 61 |
+
"name": "data",
|
| 62 |
+
"type": "string",
|
| 63 |
+
"description": "",
|
| 64 |
+
"default": "https://www.instagram.com/p/CZ7Ma5sNdif/"
|
| 65 |
+
}
|
| 66 |
+
],
|
| 67 |
+
"optional_parameters": [],
|
| 68 |
+
"code": "import requests\n\nurl = \"https://instagram174.p.rapidapi.com/api/v1/media/https://www.instagram.com/p/CZ7Ma5sNdif//id\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram174.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 69 |
+
"convert_code": "import requests\n\nurl = \"https://instagram174.p.rapidapi.com/api/v1/media/{data}/id\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram174.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 70 |
+
"test_endpoint": ""
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"name": "Get user feed",
|
| 74 |
+
"url": "https://instagram174.p.rapidapi.com/api/v1/user/25025320/feed",
|
| 75 |
+
"description": "Get the feed of a user",
|
| 76 |
+
"method": "GET",
|
| 77 |
+
"required_parameters": [
|
| 78 |
+
{
|
| 79 |
+
"name": "id",
|
| 80 |
+
"type": "NUMBER",
|
| 81 |
+
"description": "",
|
| 82 |
+
"default": "25025320"
|
| 83 |
+
}
|
| 84 |
+
],
|
| 85 |
+
"optional_parameters": [
|
| 86 |
+
{
|
| 87 |
+
"name": "max_id",
|
| 88 |
+
"type": "STRING",
|
| 89 |
+
"description": "",
|
| 90 |
+
"default": "2796754904080592191_25025320"
|
| 91 |
+
}
|
| 92 |
+
],
|
| 93 |
+
"code": "import requests\n\nurl = \"https://instagram174.p.rapidapi.com/api/v1/user/25025320/feed\"\nquerystring = {\"max_id\": \"2796754904080592191_25025320\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram174.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 94 |
+
"convert_code": "import requests\n\nurl = \"https://instagram174.p.rapidapi.com/api/v1/user/{is_id}/feed\"\nquerystring = {\"max_id\": \"2796754904080592191_25025320\"}\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram174.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers, params=querystring)\nprint(response.json())\n",
|
| 95 |
+
"test_endpoint": ""
|
| 96 |
+
},
|
| 97 |
+
{
|
| 98 |
+
"name": "Get user info",
|
| 99 |
+
"url": "https://instagram174.p.rapidapi.com/api/v1/user/25025320/info",
|
| 100 |
+
"description": "Get information about a user",
|
| 101 |
+
"method": "GET",
|
| 102 |
+
"required_parameters": [
|
| 103 |
+
{
|
| 104 |
+
"name": "id",
|
| 105 |
+
"type": "NUMBER",
|
| 106 |
+
"description": "",
|
| 107 |
+
"default": "25025320"
|
| 108 |
+
}
|
| 109 |
+
],
|
| 110 |
+
"optional_parameters": [],
|
| 111 |
+
"code": "import requests\n\nurl = \"https://instagram174.p.rapidapi.com/api/v1/user/25025320/info\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram174.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 112 |
+
"convert_code": "import requests\n\nurl = \"https://instagram174.p.rapidapi.com/api/v1/user/{is_id}/info\"\n\nheaders = {\n \"X-RapidAPI-Key\": \"SIGN-UP-FOR-KEY\",\n \"X-RapidAPI-Host\": \"instagram174.p.rapidapi.com\"\n }\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n",
|
| 113 |
+
"test_endpoint": ""
|
| 114 |
+
}
|
| 115 |
+
],
|
| 116 |
+
"standardized_name": "instagram_v7"
|
| 117 |
+
}
|
toolbench/toolenv/tools/Social/instagram_v7/api.py
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_user_id_from_username(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Finds user id by username"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram174.p.rapidapi.com/api/v1/user/{username}/id"
|
| 15 |
+
querystring = {}
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram174.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 get_media_info(is_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"Get information about a media by providing the media id."
|
| 33 |
+
|
| 34 |
+
"""
|
| 35 |
+
url = f"https://instagram174.p.rapidapi.com/api/v1/media/{is_id}/info"
|
| 36 |
+
querystring = {}
|
| 37 |
+
|
| 38 |
+
headers = {
|
| 39 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 40 |
+
"X-RapidAPI-Host": "instagram174.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 get_media_id_from_data(data: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 52 |
+
"""
|
| 53 |
+
"Get the id of a media from some data like a link."
|
| 54 |
+
|
| 55 |
+
"""
|
| 56 |
+
url = f"https://instagram174.p.rapidapi.com/api/v1/media/{data}/id"
|
| 57 |
+
querystring = {}
|
| 58 |
+
|
| 59 |
+
headers = {
|
| 60 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 61 |
+
"X-RapidAPI-Host": "instagram174.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 get_user_feed(is_id: int, max_id: str='2796754904080592191_25025320', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 73 |
+
"""
|
| 74 |
+
"Get the feed of a user"
|
| 75 |
+
|
| 76 |
+
"""
|
| 77 |
+
url = f"https://instagram174.p.rapidapi.com/api/v1/user/{is_id}/feed"
|
| 78 |
+
querystring = {}
|
| 79 |
+
if max_id:
|
| 80 |
+
querystring['max_id'] = max_id
|
| 81 |
+
|
| 82 |
+
headers = {
|
| 83 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 84 |
+
"X-RapidAPI-Host": "instagram174.p.rapidapi.com"
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 89 |
+
try:
|
| 90 |
+
observation = response.json()
|
| 91 |
+
except:
|
| 92 |
+
observation = response.text
|
| 93 |
+
return observation
|
| 94 |
+
|
| 95 |
+
def get_user_info(is_id: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 96 |
+
"""
|
| 97 |
+
"Get information about a user"
|
| 98 |
+
|
| 99 |
+
"""
|
| 100 |
+
url = f"https://instagram174.p.rapidapi.com/api/v1/user/{is_id}/info"
|
| 101 |
+
querystring = {}
|
| 102 |
+
|
| 103 |
+
headers = {
|
| 104 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 105 |
+
"X-RapidAPI-Host": "instagram174.p.rapidapi.com"
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 110 |
+
try:
|
| 111 |
+
observation = response.json()
|
| 112 |
+
except:
|
| 113 |
+
observation = response.text
|
| 114 |
+
return observation
|
| 115 |
+
|
toolbench/toolenv/tools/Social/instagram_v8/api.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_account_info(username: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 10 |
+
"""
|
| 11 |
+
"Retrieves json of instagram account info by username"
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
url = f"https://instagram74.p.rapidapi.com/account-info"
|
| 15 |
+
querystring = {'username': username, }
|
| 16 |
+
|
| 17 |
+
headers = {
|
| 18 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 19 |
+
"X-RapidAPI-Host": "instagram74.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 get_account_posts(userid: int, after: str='QVFCYWI2WDlNS2luREg1d040d1pjYlJlRVRjWUpBSjljWDNpZGpodms1VmpBUUtfSGtPWFd6Vm5lV2k4bkFDMkh1bmpBa19IX3RaY1VLSjZ6NFo1R0kxVA==', first: int=12, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
|
| 31 |
+
"""
|
| 32 |
+
"Get instagram medias by username id."
|
| 33 |
+
after: Cursor after which the medias should be loaded. Technically this serves as \"offset\". Get current cursor via response.pageinfo.endcursor (see example response)
|
| 34 |
+
first: default value 12
|
| 35 |
+
|
| 36 |
+
"""
|
| 37 |
+
url = f"https://instagram74.p.rapidapi.com/account-medias"
|
| 38 |
+
querystring = {'userid': userid, }
|
| 39 |
+
if after:
|
| 40 |
+
querystring['after'] = after
|
| 41 |
+
if first:
|
| 42 |
+
querystring['first'] = first
|
| 43 |
+
|
| 44 |
+
headers = {
|
| 45 |
+
"X-RapidAPI-Key": toolbench_rapidapi_key,
|
| 46 |
+
"X-RapidAPI-Host": "instagram74.p.rapidapi.com"
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
response = requests.get(url, headers=headers, params=querystring)
|
| 51 |
+
try:
|
| 52 |
+
observation = response.json()
|
| 53 |
+
except:
|
| 54 |
+
observation = response.text
|
| 55 |
+
return observation
|
| 56 |
+
|