Shahzad Manzoor
Shahzad Manzoor

Reputation: 160

Graph API, Get ads filter with created date or Date range

Is there any way to get ads in specific time range using graph API. I need to get ads from the last week.

Right now I'm doing this:

/act_{ad_account_id}/ads?limit=25&time_rang[since]=$date_from&time_range[until]=$date_now

But this is not working, it's returning ads even from outside the specified time range.

Upvotes: 2

Views: 1359

Answers (3)

espy
espy

Reputation: 11

For those using the Facebook Node.js Business sdk, Facebook is expecting seconds and not milliseconds (which is what you might expect while working with JavaScript) for the updated_since.

Upvotes: 1

Good Friday
Good Friday

Reputation: 11

If anyone wonders what value of updated_since is, it is timestamp.

Upvotes: 1

Jeff S.
Jeff S.

Reputation: 81

You can filter on updated_since, and request the created date in the result, which your code can then use to include or exclude.

act_{account ID}/ads?fields=created_time&updated_since=1485925200

Upvotes: 1

Related Questions