Hi! One of our clients just asked us to get their data on a daily basis to integrate it to their data flow. Although I’ve been retrieving data automatically for the last year using the Ads API through Python for a client with no problems on the road, I’m facing issues with this new client.
Basically, my script requests (using batches) all the data of the current year. For this, as you may know, first it gets the existing line items and then iterates over them to download the data. The problem is that for most of my items I’m receiving this error:
{'code': 'NOT_FOUND', 'message': 'Line Item xxxx was not found for Account xxxxxx', 'parameter': 'line_item_id'}
This had never happened to me before. How can I get over it? This is the endpoint I’m using to get the line items:
GET
/{API_VERSION}/accounts/{ACCOUNT_ID}/line_items/{e['entity_id']}
Thanks in advance. Regards.
First, we recommend starting with the Active Entities API endpoint to identify all entities that had been updated in the last year. This allows pulling data in the most efficient way and skips entities that may not have been promoted.
Could you provide the line item IDs and account IDs that are returning this error?
If you mean this endpoint, I’m calling it already:
/API_VERSION/stats/accounts/{account_id}/active_entities
Now, the account ID is xxxxxxxx, and some of the line items are xxxxxx, xxxxxxx, xxxxxxx, xxxxxxx.
These entities are for Promoted Trends and aren’t available via the API. Your platform can safely ignore these and we are looking to filter these out.
1 Like
Oh, ok, good to know it. Are Promoted Trends the only elements I can not request via the API?