Created
July 8, 2021 12:49
-
-
Save koonagi/adafcaab72e372db5a5485e970d940a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import pandas as pd | |
pd.set_option('display.max_rows', None) | |
# アクセス情報 | |
business_account_id = '<user_business_account_id>' | |
token = '<your_token>' | |
username = '<username>' | |
fields = 'name,username,biography,follows_count,followers_count,media_count' | |
# ユーザー情報を取得する | |
def user_info(business_account_id,token,username,fields): | |
request_url = "https://graph.facebook.com/v11.0/{business_account_id}?fields=business_discovery.username({username}){{{fields}}}&access_token={token}".format(business_account_id=business_account_id,username=username,fields=fields,token=token) | |
# print(request_url) | |
response = requests.get(request_url) | |
return response.json()['business_discovery'] | |
print(user_info(business_account_id,token,username,fields)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment