24
The following principles are at play:
The web front-end (i.e. http://stackoverflow.com) is not meant for automated consumption (e.g. scrapers, bots).
The API (i.e. http://api.stackexchange.com) is meant for automated consumption.
Apparently up till a short while ago, the former was not really enforced. Now it is, and your bot has to solve a CAPTCHA. That ...
19
quota_max is the maximum number of API calls allowed per day per IP-address.
quota_remaining is the number of API calls you have remaining for this day from this IP-address.
Once you've exhausted that quota any API call will return you an error.
By default everyone is granted 300 API calls per day per IP-address. To increase that quota to 10,000 calls, ...
18
See the "Safety" section in the API's Filters doc:
Filters also carry a notion of safety, which is defined as follows. Any string returned as a result of an API call with a safe filter will be inline-able into HTML without script-injection concerns. That is to say, no additional sanitizing (encoding, HTML tag stripping, etc.) will be necessary on returned ...
17
Thanks for reporting. We're working on porting our websites to ASP.NET Core, and those errors you've seen were a result of this.
We caught the first error ourselves on a canary build and fixed it since it surfaced in the logs before deploying a full build. That full build contained the 2nd bug (no CORS headers), which we didn't see in our logs, but fixed ...
16
There's an issue with the join you are using between Posts and PostTags, use: p.Id = t.PostId:
Try this one: https://data.stackexchange.com/stackoverflow/query/edit/433365#resultSets
SELECT
Count(*) AS QuestionCount
FROM
Posts p
JOIN PostTags t on p.Id = t.PostId
WHERE
t.TagId = 1589
AND p.PostTypeId = 1 -- Questions
Edit:
As stated in ...
16
It looks like the scope query parameter you passed when obtaining your access token didn't have the access_team|stackoverflow.com/c/your-team-url, as detailed in the Teams-specific docs.
I think you'd want scope=no_expiry,access_team|stackoverflow.com/c/your-team-url.
13
The OAuth implementation requires registering the client application; that will generate a client id and secret id.
You can register the client application here.
13
Yes, You can embed your stackoverflow profile onto your website using your user flair.
see here https://stackoverflow.com/users/flair
Simply copy and paste the HTML snippet(you will get one in the above link) wherever you want to show off your Stack Overflow flair
12
This was fixed in the latest deploy of the API.
11
Is it easy to make a mass edit...
It doesn't matter how easy or hard it is, we still shouldn't do it. Editing shouldn't be automated like this. A script that mass-edits one typo on thousands of posts will not find all of the other issues with those posts that a human editor (most often) will.
Also, many of those "thousands" of edits are duplicates in ...
answered May 29 '18 at 18:22
Bill the Lizard
368k4545 gold badges276276 silver badges302302 bronze badges
10
As @Cupcake mentioned, there's the Data Explorer.
Although judging from your profile, you already know enough SQL to do it on your own, I went ahead and made the query myself since I was curious.
Link to query here
Code:
SELECT TOP 100 p.Id as [Post Link], p.CreationDate as [Create Date],
p.ClosedDate as [Close Date]
from Posts p
where p....
10
The API states that the data access is read-only.
Starting with the release of Stack Overflow For Teams, the Stack Exchange API exposes read-only access to data stored in private Teams.
So no; you can't use the API alone to manage a user list and deactivate it. It'd be an awesome feature, though.
answered Apr 12 '19 at 16:01
Makoto
95.8k108108 gold badges688688 silver badges10251025 bronze badges
9
Teams API access still works fine for me. Something not shown in the question is the problem.
Don't use total for the filter. That filter omits crucial wrapper and error properties and may be masking the original problem.
You don't mention Client Secret so verify that you are using implicit OAuth.
Go ahead and reset the Client Secret, on your app's ...
9
The API won't help here; it doesn't provide details about deleted posts.
SEDE does in some way; it has a PostsWithDeleted table containing some information about deleted posts. You can join it with the Votes table looking for spam votes (type 12), like this.
However, to actually see those posts, you have to have 10k reputation. The PostsWithDeleted table ...
answered Dec 9 '19 at 10:00
Glorfindel
19.6k2929 gold badges323323 silver badges335335 bronze badges
8
Yes, with the Stack Exchange API. The documentation home page lists all available methods.
answered Nov 6 '16 at 23:07
user247702
21.8k1616 gold badges153153 silver badges179179 bronze badges
8
Some of this info can already be found in existing SEDE queries:
Number of Questions per Time Period:
Day: https://data.stackexchange.com/stackoverflow/queries?q=questions+asked+per+day
Month: https://data.stackexchange.com/stackoverflow/queries?q=questions+asked+per+month
Year https://data.stackexchange.com/stackoverflow/queries?q=questions+asked+per+...
8
The easiest way is just to use the search page and include the term is:answer (from the help page on searching), e.g. this query returns only answers containing NullPointerException.
It is possible to use the API for this; the q parameter supports (roughly) the same syntax as the search box on the site. You can experiment on this page to see what URL you ...
answered Oct 18 '17 at 20:22
Glorfindel
19.6k2929 gold badges323323 silver badges335335 bronze badges
8
For "Active" questions, almost every route supports sorting by last_activity_date (Descending).
For example: /2.2/posts?order=desc&sort=activity&site=stackoverflow, which shows the most recently active posts first.
For "Hot" questions, the /questions route and the /me/tags/{tags}/top-questions route have this as an optional sorting. (No clue why it'...
7
No need to mess around with CSS files, separate icons are already available in the API: https://api.stackexchange.com/docs/sites
Example for Stack Overflow:
"high_resolution_icon_url": "https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png",
"favicon_url": "https://cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico",
"icon_url": "https://...
answered May 29 '17 at 17:49
user247702
21.8k1616 gold badges153153 silver badges179179 bronze badges
7
This information is not available in the public API.
Some additional comments...
The user email is private; it is not available to the general public. This is in keeping with standard (EU at least) data privacy and protection laws, c.f. GDPR.
I can't think of any reason why the general public should have access to every user's email address, even if the ...
7
Yes, you'll be fine, as long as you follow the API Terms of Use. You should also read Throttles section of the documentation for info on the rate-limiting system, if you intend to make a lot of requests.
If you republish or use user-created content from Stack Exchange, it's important to attribute both the users who created it, as well as SE, as described in ...
7
Yes, there is the Stack Exchange API.
7
Thanks to DavidG's comment, I found that user information including reputation can be obtained by sending a request to the Stack Exchange API.
This endpoint:
https://api.stackexchange.com/2.2/users/{id}?site=stackoverflow
gives a JSON object of the form:
{
"items": [{
"badge_counts": {
"bronze": 55,
"silver": 27,
...
6
No, you can't get the original HTML from the question but you can get the Markdown that was posted for each revision. See When does the question/answer text get converted from markdown to html
This simple query does that for a single post:
select creationdate
, text
, name
from posthistory ph
inner join posthistorytypes pht on pht.id = ph....
5
You can register for an application-specific API token at the StackApps.com site:
Upon registering, you'll be provided an API key which grants your app a much larger per-day request quota than using the API anonymously.
The registration link is listed on the homepage, in the sidebar, together with the API documentation link and a link to manage any ...
answered Sep 5 '14 at 21:40
5
The Data Explorer runs on a copy of the SE database, this copy is updated every week or so. To get the current reputation you would have to run the queries on the production database.
Allowing random users to query the production database would obviously be a terrible idea.
4
[post] through a bash function that posts to Stack Overflow.
Is doing something like this possible?
Everything is possible, but in this case I'd refrain from it.
When you post a question, you're supposed to keep looking at it for at least a couple of minutes, so you can watch for comments, edits and perhaps even answers:
Post the question and respond to ...
4
There is no API support. (Here's the cross site duplicate on Stack Apps.)
But the RSS feed, as mentioned on MetaSE, still works.
4
As stated in the comments, usernames are not unique and can be changed for a given user ID.
Nevertheless, you can get a list of current name matches from the API using the /users route.
For example:
/2.2/users?inname=mobet&site=stackoverflow
Currently yields (return fields filtered):
{
"badge_counts": {"bronze": 15, "silver": 3, "gold"...
4
How bad is this?
I don't think it's devastating that an API key gets leaked, as API keys alone provide read-only access with per-IP quotas - to impersonate users with write access you would need an access token as well.
As for who to contact, the owner(s) of the key would be the best person/people to notify. In this case, you should contact NobodyNada and ...
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
api × 58support × 33
discussion × 11
feature-request × 9
bug × 6
stack-overflow-for-teams × 6
data-explorer × 5
status-completed × 4
jobs × 3
reputation × 3
profile-page × 3
stack-exchange × 3
answers × 2
status-bydesign × 2
search × 2
questions × 1
edits × 1
documentation × 1
design × 1
badges × 1
bounty × 1
developer-story × 1
stack-snippets × 1
spam × 1
android-app × 1