facebookfacebook-ads-apifacebook-marketing-api

Facebook Marketing API - Create ad without business page


is it possible to create an ad via the Facebook Marketing API without having or using a Facebook business page? I hadn't found any reference that confirms this guess.


Solution

  • Yes, you can create a link ad that is not connected to a page using an adcreative with fields title, body, object_url, and image_file or image_hash. For actor_id use your FB user ID which you can get from reading the /me endpoint.

    More info on adcreatives is at https://developers.facebook.com/docs/marketing-api/adcreative/v2.4

    Here's the curl example from that page.

    -F 'object_url=https://www.link.com' \
    -F 'title=my title' \
    -F 'body=my ad body' \
    -F 'image_hash=<IMAGE_HASH>' \
    -F 'actor_id=<ACTOR_ID>' \
    -F 'access_token=<ACCESS_TOKEN>' \
    https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adcreatives