Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
11

First of all, version 1.1 of the API has been deprecated for quite some time now. Users are strongly encouraged to move their applications over to version 2.1. The URL for retrieving information about a question looks something like this: http://api.stackexchange.com/2.1/questions/ question_id ?site= site_name For example, to retrieve information about ...


9

You need to encode the # character (to %23) http://api.stackoverflow.com/1.0/questions?title=true&tagged=c%23


7

Confirmed; see bottom section, below. However, please refer to Provide a way to retrieve questions and answers that have been deleted -- which is "status-planned". This is a feature, not a bug. And this kind of feature has been requested many times. So, shush please, don't ruin it for us. ;) Confirmation info: You can see this behavior (for now) with this ...


7

Not sure which posts you should setup with this script? I made a quick SEDE query to help you find common duplicate target posts for your tag of choice. https://data.stackexchange.com/stackoverflow/revision/909952/1132398/most-common-duplicate-targets-for-a-tag TopItems it the max items you want back. Probably good to leave this less than 50. TargetTag is ...


6

Yes, that bug is annoying, especially since specifying a todate that's before the fromdate returns a valid result set, EG: { "items": [], "has_more": false, "quota_max": 10000, "quota_remaining": 9995 } -- rather than an error. Having the dates be equal is theoretically possible. Having negative time is impossible (in this context). However, ...


5

To get the questions in a tag you can simply use the /questions endpoint as that does accept a tagged query parameter, from that document page: To constrain questions returned to those with a set of tags, use the tagged parameter with a semi-colon delimited list of tags. This is an and contraint ... The API endpoints can relatively simple be used from ...


4

The most straightforward way to get the body is to use the named withbody filter, which you pass in as the value of the filter parameter (example). This will give you all of the default fields, along with the post body. You can also create a custom filter that passes back question.body and answer.body where appropriate along with your select choice of other ...


4

I've been a long time user of this script and really loved it. The makeover is excellent, 1-click vote is pretty nice! Some minor issues: On Stack Overflow: Notice that the starting letter of the question("I") is still at the top Seems to happen at cases where the question length exceeds certain limit Example: https://stackoverflow.com/questions/8830/...


4

Confirmed the bug on a post that accrues comments much slower than a typical Stack Overflow question does. Currently, the OP's filter returns "comment_count": 1 on that post. There are no comments. I believe this is a side-effect/bug/quirk with how the API appears to be counting the comments. ¿Perhaps it is counting Ids in the comment table and not ...


4

There's no one way. Here's a recipe you can use: Make a proper app post here on StackApps. See How to list your application/library/wrapper/script here. Look for posts on Meta Stack Overflow (MSO) and/or on Meta Stack Exchange (MSE) where your app might make part of a good answer. If you find such posts, make proper answer(s) to them -- linking both to the ...


4

The various /questions routes do allow you to simultaneously retrieve answers, if you set the right filter. A good starting filter for getting questions with answers is: !gB7hjL3lhJ*Cnfe63rh6pAm74J(5qrOZKbL To Customize a Filter: Go to the /questions documentation page. Scroll to the Filter Edit Tool: Click on the tool and this dropdown appears: Adjust ...


4

Probably the most cost-effective way is to poll /questions every minute or two. (Results are cached so, polling more than once a minute probably won't do anything but chew up your quota.) Related: Provide a streaming API instead of forcing API users to poll Alternatives: You can get real-time notifications by hooking into one of the undocumented ...


3

If the code tags are <pre>s, then \n is fine. Pre means "preformatted;" it makes the browser ignore the usual rules and preserve whitespace, etc. Repeat after me: "There is no such thing as a special character." Html is perfectly happy to receive UTF-8.


3

feature-request status-completed Support /unanswered tab as well. An example: http://stackoverflow.com/unanswered/tagged/regex


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

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

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

There really is no particularly satisfactory way to do this since all versions of last_activity_date conflate a question's activity with the activity of its answers. You are going to have to fetch lots of items and filter out the chaff yourself. There are 2 main routes you can take, events or questions: A) Use the /events route: Use a filter that ...


3

This appears to be closely related to the bug: Why is comment_count=1 (incorrectly) when this particular filter is used?. The workaround from there -- altering the filter by: selecting comment.comment_id and selecting question.comments appears to work in this case too. (Although, in at least one instance, it seemed to need question_id as well. But this ...


2

No, you can't do it because py-stackexchange is a library based on SE API that does not provide that kind of search. You should use Google API search instead.


2

Personally I think listing apps that use the data dump are fine -- it's an expansion of scope for stackapps, but then so was adding support for browser scripts. Generally anything third-party and programmery that makes the network more awesome should go here.


2

This was fixed in the latest deploy, there was a problem selecting the most recent notice for post with multiple notices (which is rare).


2

Thanks to Dave for this ;) Your for loop should be: var i, l; for (i = 0, l = data.items.length; i < l; i++) { // Get your data here }


2

You already know the site, it has to be built in to every /questions query. But, if you are querying separate sites with concurrent AJAX queries, merely encapsulate the site name in your AJAX callback. See this Stack Overflow question for an example of doing that in javascript. Alternatively, you can parse the link property of the question response to ...


2

There is no app, exactly like that but two are pretty close (they don't have any annoying sounds). These both run on Windows + Linux platforms and provide desktop alerts for favorited/tracked tags. Check out: StackApplet: , built on the QT framework New Q!: , Uses the Chrome browser for its engine.


2

It would be simpler and more precise if you made users provide their ID number instead (for example, yours is 1637442 on Stack Overflow). Then you'd merely use the /users/{ids}/questions route to get the questions. If you really must have access by username, then: First do a search using the inname parameter of the /users route. It is recommended that you ...


2

Make sure that you have coded all the bits that you can do first. This ensures that any request for help is genuine. If the project idea is any good, you should find that, although you can't get what you want, you can get what you need. Have you tried Microsoft's CodePlex. From here you can create a 'publishable', and also advertise (for free) job ...


2

You can use the /search method with tagged and intitle For example: http://api.stackexchange.com/2.2/search?order=desc&sort=activity&tagged=rest&intitle=api&site=stackoverflow will search for questions on Stack Overflow with api in the title and that are tagged with rest. The first two items I get when running this are: { "items": [ {...


2

You would use either: /search/advanced or /search/excerpts Then: Set the tagged parameter to your tag. Set the accepted parameter to True, if you want questions with accepted answers... OR Set answers to 1, if you want questions that have any old answer at all. Set pagesize to 10. Set order to desc. Set sort to creation. For example, the following query ...


2

Yes, you need to page through the results. See the doc page on paging. So, you would probably want to set the max pagesize(100) and then make a sequence of calls. EG: /2.2/questions?page=1&pagesize=100&order=desc&sort=activity&tagged=r /2.2/questions?page=2&pagesize=100&order=desc&sort=activity&tagged=r /2.2/questions?page=3&...


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