Tag Info

Hot answers tagged

6

Markdown. While you could use HTML (just like you can in posts), each time you use HTML instead of Markdown to format a post, Evan Carroll rapes a little kitten and sticks another needle in his Jeff Atwood voodoo doll.


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.


6

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 ...


5

There is no tutorial for the API, nor is there likely to be one -- at least officially. There is a "Hello World" introduction. To use the current API (version 2.1), you really only need to know/do: How to make an HTTP GET request, in the language of your choice. There are also various user-supplied libraries in .net, PHP, Python, etc. to help with this. ...


5

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 ...


5

You don't explicitly need permission, but you must follow certain rules and legal requirements. Refer to Jeff Atwood ♦'s answer to "Etiquette of Screen-scraping Stack Overflow?": We regularly block (IP range ban) unknown scrapers that do not identify themselves and/or have poor behavior patterns. These bans are permanent until someone emails us to make ...


4

See the API docs; there is no mention of a WSDL file for the API. Further, WSDL is typically used for old XML and/or SOAP API's. Since the Stack Exchange API is JSON based, it seems unlikely that an official WSDL exists. (The API docs also make no mention of XML or SOAP.)


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 = ...


4

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

It's a bit of a Catch-22. Work around it by making an app (or script) post for your app (or script), but put "(Placeholder)" in the title and tag it with placeholder. Also, indicate in the post that the app is not yet ready for prime time. This has already been done a few times, for example: "Chatdump - a site monitor (placeholder)" "A small Stack ...


3

If you already have a token, then you can use the /me/associated network route to get the associated site for the authorized user. There's a similar route that takes a network account ID and does not require an active access token.


3

Currently the API does not let you get "featured" questions (questions that have bounties) using or logic with the tag parameters. That is, you cannot search for questions that: Have a bounty AND (have Tag-A OR Tag-B) It might make sense to add a hasbounty parameter to the /search/advanced path. Workaround: In the meantime, since the number of featured ...


3

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.


3

Assuming you're talking about these numbers for a particular user, you can use the /users/{id}/associated route with the given user's network ID to get these values for each of the sites the user is a member of. You can selectively filter through the results to pick out the sites that you're interested in.


3

As of this writing https://api.stackexchange.com does only allow the writing of Comments. See https://api.stackexchange.com/docs/write Starting with version 2.1, the Stack Exchange API provides limited support for writing to sites in the Stack Exchange network. There are a number of constraints imposed to prevent abuse and loss of quality on Stack ...


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 ...


3

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 ...


3

From the docs for /users/{ids}/reputation (emphasis mine): Gets a subset of the reputation changes for users in {ids}. I think you'll find that the API method you're using is working exactly as designed - it's just not designed to do what you were expecting. Fortunately, /users/{ids}/reputation-history will yield precisely what you're after. ...


3

For analyzing large chunks of data, don't use the API. Use the Stack Exchange Data Explorer (SEDE), that's what it's there for. SEDE data lags real-time by 1 to 5 weeks, but that's no big problem for most statistical purposes. For intense "Big data" analysis beyond even SEDE's capabilities, use the quarterly data dumps. (Thanks, Tim Stone, for the ...


3

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 ...


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

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 ...


2

The user_id is the per-site user id (in the above case, for Stack Overflow). The account_id is the global Stack Exchange account id (i.e. the id of your Stack Exchange account). The account_id is probably the best key if you're looking for a global identifier, since the individual per-site user ids will be different on each site the account is associated ...


2

I haven't used PhoneGap yet, but they claim that you develop apps with plain old JS, CSS, and HTML. If that's true, then use the API just like you would from a web page -- with simple AJAX calls. Here's a working example (using jQuery): var userID = 1416412; var pageNum = 1; var pageSize = 100; var siteParam = 'stackoverflow'; var appKey ...


2

This would be a two-step process if the /posts/{ids} path returned title, but it doesn't. Since the /answers/{ids} path, does return title (with an optional filter setting), then it should be easy-ish for /posts/{ids} to do so as well. Perhaps this would be a good feature request? Anyway, as it stands now, you must do this in pages and in 3 steps per ...


2

The flag I think you're referring to was a recommend closure flag, which results in the post going to the Close Votes queue – not the actual flag queue, which currently has no backlog. Our flag response time is pretty good at the moment, sitting at a little under two and a half hours. It had recently been even better than that recently, but I've ...


2

The page where you can find the API key for your registered application says that the key doesn't need to be kept secret: [The key] is not considered a secret, and may be safely embed [sic] in client side code or distributed binaries. Abuse is typically an issue for the end-user, so you shouldn't be concerned about it beyond recognizing backoff ...


2

The fix for me was unchecking "Enable Client Side OAuth Flow"


2

HTTP GET $.get("https://api.stackexchange.com/2.1/posts/144890/comments/add?site=meta.stackoverflow&key=ArbQjyecuJQ((&access_token=2YVSaccesstokenomg))&body=Another%20API%20test", console.log) {"error_name": "no_method", "error_message": "this method cannot be called this way", "error_id": 404} HTTP POST ...


2

Reference: Stack Exchange API Authentication Looking for a beginner's tutorial to using the API Yeah the registration form now says, "Website URL is required". So, if you don't have your own website: Enter stackexchange.com as the Application Website. Enter stackexchange.com as the OAuth Domain. This will allow you to use ...



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