How to get last updated Facebook ads
**How to Get Last Updated Facebook Ads**
**Introduction**
Stay up-to-date with your Facebook advertising campaigns by filtering them based on their last updated time. This feature allows you to retrieve ads that have been recently modified to track performance and make data-driven decisions.
**Filtering Option**
To filter ads, use the `filtering` parameter with the following format:
```
filtering=[{field: "<object>.updated_time", operator: ">\>", value: <unix time>}]
```
**Step-by-Step Guide**
**1. Unix Time**:
Convert the desired filter date into Unix timestamp using a conversion tool. For example, to retrieve ads updated after February 1, 2018, use:
```
1517443200
```
**2. Campaign Retrieval**:
To retrieve all campaigns updated after February 1, 2018, use the following cURL command:
```
curl -G \
-d 'access_token=<ACCESS_TOKEN>' \
-d 'filtering=[{field:"campaign.updated_time",operator:">\>",value:1517443200}]' \
'https://graph.facebook.com/v2.12/act_<ACCOUNT_ID>/campaigns'
```
**Note**: Replace `` and `` with your actual values.
**3. Python Example**:
To filter ad sets that were updated in the last one day using Python, use the following code:
```python
import facebook
# Get the Facebook graph API access token
access_token = ''
# Initiate an API call object
graph = facebook.GraphAPI(access_token=access_token, version='2.12')
# Set the start time for filtering
last_24_hours = int(time.time()) - 86400
# Make the API call to retrieve ad sets
ad_sets = graph.get_object('act_<ACCOUNT_ID>/adsets', fields='name,updated_time', filtering=[{'field': 'adset.updated_time', 'operator': '>\>', 'value': last_24_hours}])
```