Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a WordPress plugin that displays all Questions or Answers from a given user in a given Stack site. In my config file, instead of checking for IMPLICIT, I'm simply using

// if(defined('IMPLICIT'))
// {
    API::$key = 'MY-KEY';
    Auth::$client_id = MY-CLIENT-ID;
// }
// else
// {
//    API::$key = '';
//    Auth::$client_id = 0;
//    Auth::$client_secret = '';
// }

I created a StackApp in, filled the oAuth Domain with my own and left this options unchecked:

client side oauth and desktop application oauth redirect url

I'm not sure about:

  1. Is the API Key dependent on the domain where the plugin is running?

  2. Is this a correct configuration for public release and anonymous usage?

  3. Or should I request the plugin users to enter their own key and client id?

As a matter of fact, my plugin works with the default $key and $cliend_id even in localhost [1]. And as the plugin does not request any private information, I think OAuth doesn't comes into play, or does it? I have zero experience with this.

I've read Handling working of PHP API key on webpage but it didn't clarify much.

[1]: it's presenting some glitches in localhost if I try the Chuck Norris query.

share|improve this question
OAuth is not a factor for the data you are requesting. Matching the API key to domain is only done for Auth, so not a factor here. There is no need to make users get their own key for this. The key, in this case, just helps track usage and increase the daily quota. #2, I can't speak to. – Brock Adams Aug 25 '13 at 23:30
Thanks for confirming, Brock. I'm imagining a situation where 100 persons have the plugin installed and their sites make 100 requests a day. The plugin in action, this man has 26 thousand Answers, 26kA(mazing). – brasofilo Aug 26 '13 at 13:54

You must log in to answer this question.

Browse other questions tagged .