Extract All Social Media Handles & URLs
A Specrom News API endpoint for extracting all social media handles and URLs from a webpage
Categories:
This endpoint lets you quickly extract all the major social media handles found on the webpage.
Generally speaking, you will be able to find author’s social media handles apart from the social media handles of the news outlet themselves using this endpoint.
import requests
url = "https://specrom-news-api.p.rapidapi.com/"
payload = {
"api_type": "extract_social_media_handles",
"url": "https://www.wsj.com/articles/a-powerful-force-teslas-momentum-leads-stock-market-surge-11595151001"
}
headers = {
"content-type": "application/json",
"X-RapidAPI-Key": "API_Key",
"X-RapidAPI-Host": "specrom-news-api.p.rapidapi.com"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
POST / HTTP/1.1
Content-Type: application/json
X-Rapidapi-Key: API_Key
X-Rapidapi-Host: specrom-news-api.p.rapidapi.com
Host: specrom-news-api.p.rapidapi.com
Content-Length: 192
{
"api_type": "extract_social_media_handles",
"url": "https://www.wsj.com/articles/a-powerful-force-teslas-momentum-leads-stock-market-surge-11595151001"
}
Parameter | Description |
---|---|
api_type | extract_social_media_handles |
url | URL of the webpage |
Output
[
"https://www.instagram.com/wsj/",
"@WSJ",
"https://www.snapchat.com/discover/Wall-Street-Journal/4806310285",
"https://www.youtube.com/user/WSJDigitalNetwork",
"https://twitter.com/WSJ",
"https://www.facebook.com/wsj"
]