Python, facebook-python-business-sdk: How to increase graph api limit from 25 to 500

Digital Marketing Facebook Marketing API 3 years ago

3.45K 1 0 0 0

_x000D_ _x000D_ I use following API: https://github.com/facebook/facebook-python-business-sdk Where i need to specify limit fields to return more result from facebook. My code: fields = [ AdsInsights.Field.campaign_id, AdsInsights.Field.campaign_name, AdsInsights.Field.adset_id, AdsInsights.Field.adset_name, AdsInsights.Field.ad_name, AdsInsights.Field.spend, AdsInsights.Field.impressions, AdsInsights.Field.clicks, AdsInsights.Field.account_currency, ] params = { 'time_range': { 'since': for_day, 'until': for_day }, 'fields': fields, 'breakdowns': ['country'], 'action_report_time': AdsInsights.ActionReportTime.impression, 'level': AdsInsights.Level.ad # todo: need to find way to query for 500 records } async_job = account.get_insights_async(fields=params.get('fields'), params=params) Later when i watch the result object i see the following: https://graph.facebook.com/v4.0/yyy/insights?access_token=xxx&limit=25&after=zzz

User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 3 years ago
_x000D_ Simply add in the params, as example: params = { 'limit': '500', 'time_range': { 'since': for_day, 'until': for_day }, 'fields': fields, 'breakdowns': ['country'], 'action_report_time': AdsInsights.ActionReportTime.impression, 'level': AdsInsights.Level.ad } hope this help
0 views
0 shares

No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Similar Forum


Q

What are the best SEO tools for a personal website? What website or tools should I use to build and...

What are the best SEO tools for a personal website? What website or tools should I use to build and...
Q

Why is keyword research important?

Why is keyword research important?
Q

What is SEO ?

What is SEO ?