I'm trying to extract a month worth of facebook posts into a csv file. I'm extracting from the 1st May until 30th May of 2024, but once my script done running, it only extracted posts from the 30th May 2024 (it started on this date) until 12th May 2024.

It doesn't extract from the 9th May until 1st May 2024.

Below is my code:

import pyfacebook from datetime import datetime, timedelta, timezone import json import pandas as pd import time # Initialize Facebook Graph API connection (replace placeholders with your actual credentials) graph = pyfacebook.GraphAPI(access_token='my-access-token', version='v20.0') # Define the page ID page_id = 'my-page-id' # date from_date = '2024-05-01' to_date = '2024-05-30' # Construct the API request URL (notice the parameters 'since', 'until' and 'fields') posts_url = f'/{page_id}/feed?fields=attachments,created_time&since={from_date}T08:00:00&until={to_date}T23:59:59' posts_data = graph._request(posts_url).json() while True:      if 'paging' in posts_data and 'next' in posts_data['paging']:         posts_url = posts_data['paging']['next']         posts_data = graph._request(posts_url).json()         time.sleep(2)  # Increased delay to be safe     else:         break  # No more pages to retrieve      df = pd.DataFrame(posts_data) df.to_csv('facebook_data.csv', index=False) 

Here is the result, it ends on the 9th May 2024 instead of continuing until 1st May 2024:

How do I extract the full month's worth of data?

All my templates that contains media cannot be received in the WhatsApp account sent to even if the send status is successful. Here is the response after sending a template with an image: {"success":true,"response":{"messaging_product":"whatsapp","contacts":[{"input":"212690727818","wa_id":"212690727818"}],"messages":[{"id":"wamid.HBgMMjEyNjkwNzI3ODE4FQIAERgSMDI2NzkzNkZFMzMyMUYzN0E4AA==","message_status":"accepted"}]}}. But the other templates with no media are well received.

Reading Facebook's documentation, there are various levels of limits for the messages a business can send in 24 hours.

1K business-initiated conversations
10K business-initiated conversations
100K business-initiated conversations
An unlimited number of business-initiated conversations

What I need via an API call is the current limit and the number of messages sent in 24 hours, so I can halt any further sends from my application if the limit is nearly reached. Do you know what API call should I execute in order to get the limit?

At the moment, the only API call that comes close to this result is the following:

GET https://graph.facebook.com/v17.0/{phone-number-id}/phone_numbers?access_token={access_token}

the API call returns this JSON:

{     "data": [         {             "verified_name": "{company-name}",             "code_verification_status": "EXPIRED",             "display_phone_number": "{company-number}",             "quality_rating": "GREEN",             "platform_type": "CLOUD_API",             "throughput": {                 "level": "STANDARD"             },             "webhook_configuration": {                 "application": "{webhook-url}"             },             "id": "{phone-number-id}"         }     ] } 

but what I except is something like this

{   "id": "your-phone-number-id",   "quality_rating": "GREEN",   "message_limit": 1000,   "next_limit_reset_timestamp": "2024-06-06T00:00:00Z",   "tier": "TIER_1" } 

I've recently encountered an issue with a Facebook app (A php scriot) I've developed, and I'm seeking advice on how to troubleshoot it effectively. Here's the situation:

I've created a php script using the Graph API Explorer in Facebook Developer account, which automatically posts content to a Facebook page. While the app works perfectly fine when I'm logged into my admin account, I've noticed that the posts made by the app are not visible when I log out.

My facebook app mode is still in development mode. Could it be the reason?

I've checked the privacy settings of the posts, and they're set to "Public." Additionally, I've ensured that the app has the necessary permissions, including pages_manage_posts and pages_read_engagement. However, despite these precautions, the posts remain invisible to users who are not logged into an admin account.

I'm trying to change a campaign status using the Facebook Marketing API as documented here.

I managed to change the campaign status to PAUSED, but I can't change it back to ACTIVE, even though the API response indicates success.

Here is the API request I'm making:

https://graph.facebook.com/v19.0/{campaign_id}?access_token={token}&status=ACTIVE

The response I get is:

{   "success": true } 

However, the campaign status remains paused. Has anyone encountered this issue or know why the status isn't updating despite the success response?

Additional details:

  • I used the same approach to pause the campaign, and it worked perfectly.

  • The access token and campaign ID are correct.

Any help would be greatly appreciated!