Skip to content

Instantly share code, notes, and snippets.

@koonagi
Created July 8, 2021 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koonagi/adafcaab72e372db5a5485e970d940a7 to your computer and use it in GitHub Desktop.
Save koonagi/adafcaab72e372db5a5485e970d940a7 to your computer and use it in GitHub Desktop.
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