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 Exchange sites.
Apps must have a registered Stack Apps post to write. All content created via the API will have links pointing back to an app's Stack Apps post, to aid in giving an app's author feedback and in reporting abusive content.
You can add or change your app's registered post from the Stack Apps App Management page. Removing a registered post will disable write for your application, as will deleting the registered post.
The application responsible for creating content via the API will always be indicated with a link to an app's Stack Apps post. The exact manner of display is subject to change at any time.
API created comments current look like the following, when hovered over:
API write throttles are more stringent than on a Stack Exchange site. API write throttles are per-type, and work as follows:
- A user must have the associated privilege, such as comment everywhere.
- A user must have a certain minimum amount of reputation.
- Users who meet all requirements get a minimum number of writes a day, which varies by type.
- For reputation over the minimum, each type has an incremental amount of reputation that grants additional writes.
- There is a minimum amount of time required between each write action for a given type.
- All throttling is at the account level, writes spread across multiple sites or multiple apps (for the same user) are subject to the same throttle.
For example, comments (the first and only type available for writing in API version 2.1) have the following throttle behavior:
- Users must have comment everywhere.
- Users must have at least 50 reputation.
- Users start off with 3 writes a day.
- Each additional 25 reputation grants an additional write.
- Comment writes can only occur once every 5 seconds.
Note that write throttles are subject to change at any time, consumers should use the methods that return write_permissions to determine if a user can perform a certain action on a type.
Also be aware that the API does not return how many writes are remaining for a user in a given day. Applications should not make a habit of writing "exactly as often as permitted".
Words of Warning
Stack Exchange is very protective of the quality of content on its sites, and will deal harshly with harmful behavior. While it's impossible to list all forbidden behavior, a good rule of thumb is "if a user would be flagged or banned for doing something, your app will as well".
Some examples of write abuse that will be punished:
- Spam, of any sort.
- "Auto-commenting" based on post heuristics.
- Abusively "following and pestering" another user.
If you have concerns about your use case, contact us.