Hot answers tagged

12

It's pretty simple, you just append your key to the URL as a parameter. For example, looking for users 1 and 5: http://api.stackexchange.com/2.2/users/1;5?site=stackoverflow&key=YOUR_KEY_HERE So, it looks like your HTTP.call would become: HTTP.call ( "GET", urlString, {params:{site:"stackoverflow", key:"YOUR_KEY_HERE"}}, function (...


11

Refer to the Stack Exchange API, Authentication docs. It looks like you are trying to authenticate using either a server you do not control, or a local server that is not on the public internet. Crucial Points: Do not specify a redirect_uri to any server that you do not control. When you use something like redirect_uri=https://www.yahoo.com/, then a third ...


9

This is what custom filters are for. For example, if you append &filter=!BGRhem4Z)WIti9lP55R*tgr(Jq_fHC to your query, above, you will get results without upvote_count, downvote_count, or owner information. (The first two aren't included by default anyway.) An easy way to create a filter is to use the filter-edit tool, on the appropriate doc page for ...


9

No. Currently the users type does not return any private_info and neither does the user_timeline type return any voting information. No other API method allows for detecting a user's vote history except one question at a time. You would have to fetch every single question and test the downvoted and the upvoted properties. If you limited your search ...


8

You need to pass in a sufficiently large pagesize value, per the documentation: The pagesize parameter for this method is unbounded, in acknowledgement that for many applications repeatedly fetching from /sites would complicate start-up tasks needlessly. Otherwise you'll only get 30 results, the default value for pagesize. Alternatively, you can page the ...


6

Most routes that take an ID, including the /users route, will accept multiple values separated by semicolons. For example, a query like /users/1%3B22656?site=stackoverflow will give you results for both user 1 and user 22656. You can combine up to 100 ids in this fashion.


5

You can get data close-enough to "real time" for most practical purposes. See the StackHose app, for example. Read the page about the API's Throttles and Quotas. From that page we can deduce: The maximum, burst, request rate is 30 requests per second, and this risks getting your app shut down. Your app will never be allowed more than 10,000 requests per ...


5

No, Area51 isn't in the API; it's different enough from the Q&A sites that it'd have to have a rather different one anyway. There are currently no plans to make an Area51 API either.


5

The API allows you to set a pagesize of 0 to 100 (with the exception of the /sites route, which allows larger values), and defaults to a maximum of 30 items in the response. To get all of the items applicable to the API query, you need to check the has_more field to determine if you need to request subsequent pages via the page parameter. This is covered in ...


4

status-completedI asked this as a question, but apparently the convention is to report bugs/feature requests in the announcement thread. It appears, that the MathJax extension mhchem is currently not enabled in the StackPrinter app. This is rather inconvenient for most of the chemistry.se questions and answers. It would therefore be nice if this feature ...


4

Since the .getTime() value is already in UTC, you can just divide by 1000, and round. That is: var apiDate = Math.round (new Date().getTime() / 1000); works just fine. apiDate is in "unix epoch time" and the API takes these values even if the API parameter is called a "Date". But, if you want to truncate to the date only, just use: var dateTime = new ...


4

The API does not provide any method to determine a user's email address and it is unlikely to do so in the future. This would be a risk to both the user's privacy and his/her trust in Stack Exchange. And, a pressing need for this information has yet to be demonstrated, regarding the API. Note that Stack Exchange refuses to even provide the user's email hash ...


3

This seems to have been silently/magically fixed in the last 7 months (Date of Nicos Karalis' comment). Descriptions seem correct now. I had verified that they weren't correct when I upvoted this question on Apr 29 '14. Side note: It's not documented, but apparently tag-based badges are not listed unless they have been awarded at least once. Take a look ...


3

Stack Exchange supports the width attribute; see "What HTML tags are allowed on Stack Exchange sites?". The answer to that question emphatically states: You must enter the tags exactly as shown. Any deviation from this list—adding extra spaces, using single quote or no quotes, etc.—means the tag will be stripped. and: The attribute order is important! ...


3

The console JS was doing fuzzy matching on ?site; but that's not really correct, as you demonstrated. With the latest deploy it does an exact match if possible.


3

The documentation was updated sometime in the last 2 years and the API docs (version 2.2) now state that the property may be absent:


3

Your apps registered domain must match that the url passed as channelUrl. You'll need to update your app's domain from actionbox.io to cybertron-nodejs-11139.apse1.actionbox.io (or whatever other full, stable domain your app ends up at).


3

OK, a bug report: This happens every time a few seconds after I start Bartlett. Please fix this soon.


3

The default bookmarklet javascript has problems when used with mathoverflow. Because annoyingly mathoverflow ends with a .net instead of a .com. I made some changes so that it could also work with mathoverflow (feel free to improve on it): javascript:( function(){ var re = new RegExp('^https://(.*?)\.com/questions/([0-9]+)/'); var group = re.exec(window....


3

Here is a small script (stackprinter) which uses Stack Printer from the command-line: #!/bin/sh type wkhtmltopdf || { echo >&2 "wkhtmltopdf command is required. Aborting."; exit 1; } : ${1?"Usage: $0 (url)"} URL=$1 && shift HOST=$(echo "$URL" | grep -Eo "([.[:alnum:]]*?)\.(com|net|org)" | head -c-5) QID=$...


3

Are they moved to filters? Yes, you need to generate a filter that includes the question.body, question.comments, and question.answers fields. There are shorthand filters (i.e. _bca) that will do this for upgrade compatibility, but their use is discouraged and you're better off just making a filter that contains exactly what you want anyway.


3

You need to use a filter that returns those properties. The default filter does not. Also, the API is at version 2.2. You should use that unless you've a very good reason not to. So try, for example: http://api.stackexchange.com/2.2/users/55075?site=stackoverflow&filter=!G*ky*lRuarbDJTpnwEtY-a05oz Or: http://api.stackexchange.com/2.2/users/55075?...


3

If the answer is the accepted answer, is_accepted is true and anyone can see it. accepted is set to true only if the currently authenticated user is the one who has accepted the answer. For instance, if I obtain an access_token with the private_info privilege and call: /2.2/questions/30028657/answers?site=stackoverflow&key={YOUR APP KEY}&...


3

It sounds like you've either got a bug which is in fact making more requests than you think it is, or you're on a network where there's some other source of high-frequency requests. You're not supposed to have to deal with this situation in general, because this isn't an API error - it's an error from the load balancer because your IP is generating incoming ...


2

I've already used the Stack.PHP library in a WordPress plugin and am deploying a second one. They had a class conflict and using class_exists before require_once/stackphp* didn't work. I had to do this at the beginning of the file output_helper.php: if( !class_exists( 'API' ) ): require_once 'api.php'; require_once 'auth.php'; endif; require_once '...


2

I have using this for a long time , but I'm not getting any notifications now . I have tried with several tags no luck . I'm on Windows 7, chrome version Version 30.0.1599.69 . And also I tried re installing...


2

bug support @Nathan Osman, I have been trying to get authentication working with your library (which is very useful BTW). However, whenever I use the explicit flow I end up with an error on the stack exchange.com/oauth/submit page saying: Cannot return to provided redirect_uri The uri I am attempting to provide is generated using BeginExplicitFlow in ...


2

On Code Review we have people getting the Generalist Badge, but the app says we only have 38 tags that qualify, could you do some updating of that for us please?


2

Step 1: I would like to retrieve all the related tags of a particular tag using your package, much like what is accomplished here. Step 2: I would like to find the intersection between two lists of related tags. RELATED: https://stackoverflow.com/q/19898666/307454


2

UPDATE: The feature appears to be present in the, so far, undocumented API version 2.3. See captncraig's answer on this page. After all these years, it looks like this might never get implemented. However, it's not too hard to get the information via page scraping. From a browser or scraper that is logged in as the user, fetch the site's question page. ...


Only top voted, non community-wiki answers of a minimum length are eligible