0

Maybe I'm misunderstanding something. I asked a question before about a problem I'm having accessing the Facebook Ads API with python. Using the same token works fine in the graph app.

At one point in the quick start guide, when creating a new facebook app, you plug in a URL of what is supposed to be your website.

I don't have a website though I just want to call the Facebook API from my local PC with python. Is this possible?

Edit: so this is what confuses me:

Provide the Site URL of your app/website, e.g. http://localhost/my-marketing-api-app/.

Localhost? Why do I need to provide a URL of my app or website if its running locally on my PC? Does it require a URL or does it do some kind of security check against that URL?

Community
  • 1
  • 1
red888
  • 27,709
  • 55
  • 204
  • 392
  • The quick start guide is geared towards the most common use cases – and stand-alone desktop apps aren’t one of them. But if you want to implement FB login in your app, then you will need to use platform Website anyway (unless there’s a more suitable platform for your type of app), because in that case login needs to happen inside a browser (or at least a webview), and that needs the URLs to be configured, because the login process will redirect back there. – CBroe Apr 18 '16 at 12:14
  • So is that why I was getting oauth errors? Where was the breakdown exactly? I run the script on my local pc > it calls facebook with my creds and token > does facebook check if the request came from a public URL or something? – red888 Apr 18 '16 at 13:40
  • What do you mean by “it calls facebook with my creds and token”? Again, if you want to implement FB login, that has to happen inside a browser. – CBroe Apr 18 '16 at 15:16
  • But I'm using the python API. Where should I be executing the python code from the quick-start tutorial? Should I be running the code from a webserver? – red888 Apr 18 '16 at 16:36

1 Answers1

2

I am also new to using the Facebook Marketing API to create dashboards for my firm. I am definitely not an expert, but hope my experience may be of use to you.

I am using Python 2.7 on Jupyter to do my Facebook Marketing API calls, and I followed points 7 (Initialize Marketing API SDK) and 8 (Get Ad Account) from the following link:

https://developers.facebook.com/docs/marketing-api/quickstart#init-sdk

The start of my codes are exactly the same as points 7 & 8, just that of course, I had to change the information to fit my account information, which I loaded from a separate file. The API call results are in json, so I did more processing to convert them into Panda dataframes, which I then save out as csv files.

Cliff Chew
  • 906
  • 1
  • 7
  • 15