Questions tagged [api]
Questions about the Stack Exchange API *only*. If your question concerns any other API, do not use this tag. For bugs, please (also) use the version tag, EG [api-v2.2], that the bug applies to.
454 questions
-2
votes
0
answers
57
views
PLACEHOLDER - MCP Bundles: Stack Exchange Integration
MCP Bundles is a cloud-hosted platform that connects your tools to AI assistants (ChatGPT, Claude, Cursor, Perplexity) via the Model Context Protocol (MCP). We provide 4,000+ tools in MCP-ready ...
1
vote
1
answer
74
views
Obtaining all tagIds given a list of tag names in API v3
I am a Stack Overflow for Teams app developer, and given this recent announcement that API v3 is being extended to the public platform, I am hoping we can start asking API v3 questions here.
Given a ...
0
votes
0
answers
69
views
MyStackBot – A Simple Bot to Post and Fetch Stack Overflow Answers via API
App Name: MyStackBot
Client ID: 34374
API Key: rl_eaYQSUfy93Eei7G5Z8R8E8t9d
This app allows a user to:
Fetch their answers from Stack Overflow
Post new answers to questions using the Stack Exchange ...
1
vote
1
answer
389
views
Getting a "Forbidden" response when calling the API from code, but not when using the exact same URL in a browser
Forgive me if this is a dumb question, but I'm just trying the SO API, and have run into a basic problem.
If I enter the following URL in a web browser...
https://api.stackexchange.com/2.3/questions?...
0
votes
0
answers
35
views
My Stack Overflow Answer Posting Bot
I’ve built a tool that allows programmatically posting answers to Stack Overflow using the StackExchange API.
🛠 What it does:
Uses the /answers/add method to post HTML-formatted answers under ...
1
vote
0
answers
38
views
Obtaining all questions and their answers for a given set of tags in API v3
I am a Stack Overflow for Teams app developer, and given this recent announcement that API v3 is being extended to the public platform, I am hoping we can start asking API v3 questions here.
Given a ...
0
votes
1
answer
273
views
How do I handle token expiration in my application?
This request is responded to with either an error (HTTP status code 400) or an access token of the form access_token=...&expires=1234. expires will only be set if scope does not include no_expiry, ...
3
votes
1
answer
79
views
Differentiate Staging Ground posts from regular questions
Version 2.3 of the SE API does not clearly distinguish between questions that are on Stack Overflow's Staging Ground and questions on its main site. This comment on a SmokeDetector GH issue details it ...
3
votes
2
answers
1k
views
Redirect URI for a chrome extension using StackExchange API Oauth
I'm working on a developing a browser extension which uses StackExchange API authentication. I was able to successfully implement the authentication for Microsoft edge/Chrome when I added chromiumapp....
4
votes
0
answers
352
views
Is there a way to upload an image to i.sstatic.net using Python?
I am developing an image generation bot for chat (for example, chat.stackexchange.com).
I can generate the image correctly, but when it comes to posting the image, I have no idea how to upload the ...
6
votes
0
answers
313
views
stackapi.cpp - a C++20 library for the Stack Exchange API
Note: this library is not compatible with v3 of the API, and will not be updated to v3 until body_markdown is reintroduced into every kind of post and comment endpoint. This has been requested since ...
5
votes
1
answer
195
views
How can I implement a method to call the SE API that handles backoff correctly?
I'm writing JavaScript (Node.js) code that calls the Stack Exchange API. One part of the API is that it may return a non-zero value for backoff, which essentially means "wait n seconds before ...
2
votes
1
answer
165
views
Collectives Articles endpoint broken
I would like to access a list of all Collective Articles on SO. I tried
https://api.stackexchange.com/2.3/articles?order=desc&sort=activity&site=stackoverflow
which is the sample from here. ...
8
votes
1
answer
1k
views
How can I quickly get an access token for personal use?
Registering your application or script gets you a higher daily quota and is fairly simply; a step by step guide is documented here: I only need a key, what do I do?
However, what if I do want an ...
2
votes
1
answer
876
views
Is the StackExchange API free of charge?
I am brand new to StackApps, so please bear with me for a question that is hopefully obvious to most regular users.
As far as I can tell, there is no charge for accessing the StackExchange API. ...
2
votes
2
answers
506
views
How to revoke an access token generated for my application?
I generated an access token for my application and shared it with some people. Now, I wish to revoke the access token and generate a new one. I don't find any way to revoke that token.
1
vote
1
answer
5k
views
JSONDecodeError: Expecting value: line 3 column 1 (char 3)
I am trying the following simple code to get JSON from the Stack Exchange API and it gives me the following error:
JSONDecodeError: Expecting value: line 3 column 1 (char 3)
Here is my script:
...
4
votes
1
answer
190
views
Stack Overflow for Teams support
I am reading this documentation https://stackoverflow.help/en/articles/4385859-stack-overflow-for-teams-api where they mention the need to create a PAT to access StackOverflow for Teams API (https://...
8
votes
0
answers
91
views
We’re collecting feedback on how we can improve the Stack Exchange API
The Stack Exchange API allows users to programmatically query and connect to the Stack Exchange Network of sites.
The API is currently in version 2.3. We’re collecting feedback from users of the API, ...
1
vote
2
answers
1k
views
Fetch all questions of a particular tag from the Stack Exchange API in Python
I am trying to fetch all questions of the Swift tag from Stack Overflow. I created the query using https://api.stackexchange.com/docs/questions and wrote a simple wrapper in Python.
def fetch_question(...
3
votes
1
answer
78
views
getting answer body and question body in same request [duplicate]
I'm trying to get only questions and answers.
I filtered the fields, to get also the body of answers, but I don't get an answers JSON object.
What am I missing?
I know about this question, but I don'...
5
votes
1
answer
154
views
What is the latest version of the Stack Exchange API?
What is the latest version of the Stack Exchange API and its release date?
The document which I referred is for v2.3.
2
votes
1
answer
225
views
Is there a way to use the API without using localhost or a web domain?
I'm developing an SO chrome extension in React with TypeScript.
I've been reading the guide on how to use the API with OAuth and it looks fantastic for what I'm trying to do.
The problem is that the ...
1
vote
1
answer
131
views
Why are Stack Exchange API methods named like this
I'm curious about https://api.stackexchange.com/docs .
I looked up and studied the naming convention to make a REST api.
I've seen that in the naming convention, don't use verbs and in the case of the ...
6
votes
1
answer
1k
views
Please "release" and/or document API version 2.3
I was playing around a bit with Fiddler to capture traffic from the Stack Exchange iOS app. To my surprise, it uses version 2.3 of the Stack Exchange API:
I noticed here that it has some extra ...
1
vote
0
answers
752
views
How does 1 request every 5 seconds exceed the 30 requests per second limit?
I'm doing a run every 5 seconds for this API call:
url = "https://api.stackexchange.com/2.3/questions/no-answers?pagesize=30&fromdate={date_today}&order=desc&sort=creation&site=...
2
votes
1
answer
74
views
Why are these answers dated before the question was asked?
Does anyone know why some answers are shown with a date before the question was asked?
Here are a couple of examples:
Why doesn't Java have compound assignment versions of the conditional-and and ...
1
vote
1
answer
108
views
Can I use the Stack Exchange API to build a "GH Archive" like project?
I'm not sure if I can use Stack Exchange API to build a https://www.gharchive.org like project?
I studied the API throttling documentation but I am not sure.
2
votes
1
answer
2k
views
How to get access token from the hash?
I am trying to implement OAuth Stack Exchange API via Android app as client.
After a successful login from out I get the below URL how do I get or decode the access_token from the hash?
https://...
2
votes
1
answer
200
views
Is there any way to get statistics by tag?
We are Stack Overflow Teams users. We want to get the statistics by tags.
Currently only StackExchangeApiClient.getStatistics API is found which include all team's data.
And can the https://...
4
votes
2
answers
249
views
How can I retrieve the reputation I (or another user, fwiw) earned for a given tag from questions and answers?
(I've included the api-v2.3 because https://api.stackexchange.com/docs starts with Stack Exchange API v2.3.)
From this answer I see there's no way to get all questions with a specific tag.
However, ...
2
votes
1
answer
886
views
How to handle default compression on response with Java's HttpURLConnection? [duplicate]
I sent a request for question with no parameters to
https://api.stackexchange.com/2.2/questions?order=desc&sort=activity&site=stackoverflow
I received a response of 9764 bytes stored in ...
3
votes
1
answer
73
views
How do I search answer bodies for Markdown links?
The /search/excerpt query enables searching answers for specific text, but searching for Markdown links returns results that don't seem to match the query at all. For instance, the following query ...
2
votes
1
answer
62
views
Writing question API failing with error 407
I'm trying to use https://api.stackexchange.com/2.3/questions/add method
payload = {
'site': 'stackoverflow',
'title': title,
'body': body,
'tags': tags,
'key': key,
'...
3
votes
1
answer
103
views
When using the Advanced Search API endpoint, how soon after the edit grace period is question data updated?
I'm using the Questions Advanced Search API to retrieve Stack Overflow questions with a specific tag that were created in the last 15 minutes.
I've written a script which runs every fifteen minutes ...
1
vote
1
answer
1k
views
Why am I getting a 400 Bad Request error with this code?
I'm using this code (in an async function):
let about = await fetch("https://api.stackexchange.com/2.2/me?order=desc&access_token="+token+"&sort=reputation&site=gaming&...
8
votes
1
answer
265
views
Why is /questions API returning deleted questions?
In last few days I have noticed that questions API returns questions that where deleted hours before the API call.
This is a short example, if more logs are need to pin point the problem, please ...
1
vote
1
answer
108
views
"is_edited": false or "is_edited": true as an option in the API response
When working with the Stack Exchange API I noticed that there is important data (at least for what I thought to do) not available, whether the question, answer or comment was edited or not:
{
"...
1
vote
1
answer
85
views
Why does this minimal filter return no results at all?
I tried to create a 'minimal' filter
https://api.stackexchange.com/docs/questions#order=desc&sort=activity&filter=!34JvAEfIUyU-&site=stackoverflow&run=true
for the 'question' object, ...
1
vote
1
answer
95
views
How to get all communities a user is associated with?
Is there a way to get all Stack Exchange communities in which a user is active? I mean the list of communities that are displayed on a user's network profile.
4
votes
1
answer
103
views
How do I see the differences between two or more SE API filters and merge into a filter which includes all requested properties (i.e. is a superset)?
For SmokeDetector, we have several SE API filter values in use. Notably, there are separate filters for the /answers/*, /questions/* and /posts/* routes. From an organizational standpoint, I'd like to ...
4
votes
1
answer
704
views
How to create API filters?
I used the following request link to extract data from the Stack Exchange API. But I have no idea how to create "filter" as used in the request line.
Please help me understand the creation of such ...
2
votes
1
answer
108
views
What are the top level question & answer localized flag_option titles?
For the SE API, the endpoints dealing with flags (e.g. /questions/{id}/flags/options) return the flag_option type. However, the option_id values are explicitly stated as being unstable, but it's ...
3
votes
0
answers
119
views
Fortnightly Topic Challenge Automation on Puzzling.SE
Used for (meta.)puzzling.stackexchange - Creates & edits the corresponding meta posts with information from the main and meta site. E.g. creating a post for the new challenge every 2 weeks and ...
1
vote
1
answer
91
views
Using API to collect tag information - data differences
I am trying to get a list of the most popular tags on Stack Overflow.
According to the SO page, these are the most popular tags as of today:
The Python tag has 6690 questions asked this week alone.
...
2
votes
0
answers
98
views
Update Teams API documentation to reflect dependency on tier
The documentation says (emphasis mine):
Starting with the release of Stack Overflow For Teams, the Stack Exchange API exposes read-only access to data stored in private Teams.
This is slightly ...
1
vote
1
answer
171
views
How can I write (edit) one of my answers?
I started to love the Python black formatter and I want all my code on Stack Overflow to be formatted like that. So I wanted to go over the answers and apply black / blacken-docs, check if anything ...
2
votes
1
answer
140
views
Can "trends" be queried with the Stack Exchange API?
I've studied the Stack Exchange API to some extent (although I'm a newbie to such things), and it appears I can query the database using many criteria. But does Stack Exchange store any "trends&...
5
votes
0
answers
147
views
What does the /users endpoint look for when sorting on modified date?
What does the /users endpoint look for when sorting on modified date?
For the /users endpoint in the Stack Exchange API v2.3, what does the modified filter in sort field look for?
It is unclear from ...
1
vote
1
answer
177
views
How can I fetch the answers posted in last week based on tags of the question?
I see that tags are present only for questions. How can I get the answers to these questions given in last week (if any) having specific tags?