'Way to get image URL from the image hash ID of a Facebook Ad
Is there any way to use the Facebook API (or other method) to get the image URL for my ad images? I have a list of image hashes, but how can I get their URLs?
Alternatively, is there another way to get the URL of my ad images without relying on the hash? I am trying to download them all systematically.
Solution 1:[1]
Yes! Get the permalink_url of an image using the /adimages edge off the adaccount node. You can also return the hash value and filter the query by a list of specific hashes:
https://graph.facebook.com/v13/act_<AD_ACCOUNT_ID>/adimages?
fields=id,permalink_url,
hash&hashes=["<IMAGE_HASH_1>","<IMAGE_HASH_2>"]
This returns:
{
"data": [
{
"id": "<AD_IMAGE_ID>",
"permalink_url": "https://www.facebook.com/ads/image/?d=<UNIQUE_NUMBER>",
"hash": "<IMAGE_HASH_1>"
},
{
"id": "<AD_IMAGE_ID>",
"permalink_url": "https://www.facebook.com/ads/image/?d=<UNIQUE_NUMBER>",
"hash": "<IMAGE_HASH_2>"
},
],
"paging": {
"cursors": {
"before": "<VALUE>",
"after": "<VALUE>"
}
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Meli |
