Hastebin API Documentation
Hastebin has a free public API to be used programmatically in any application.
Authentication
To be able to send Hastebin API requests, you need to create an API TOKEN.
How to create a token
Sign in with your Github account, generate a token and start using the Hastebin API.
How to use a token
To use the token, add the token to the Authorization header of your request. You can refer to code snippets from the endpoints section.
{ 'Authorization': 'Bearer YOURTOKEN' }
Token validation
Once you have your token, you can keep using it unless you decide to invalidate it. To invalidate or generate a new token, sign in with your Github account and generate a new token.
API Limits
Pasted content will be available for 30 days for authorized users and 7 days otherwise.
Important: you can have just one active token at a time, and there is a strict limit of 100 requests per minute.
API Endpoints
Deprecation Notice: Our new website URL is https://www.toptal.com/developers/hastebin, and the the API endpoints have changed.
API https://hastebin.com
Error Status Codes
These are the status codes used when something goes wrong:
- 401
The user is not authorized.
- 401
Unauthorized request: missing access token. To generate a token, go to https://www.toptal.com/developers/hastebin and follow the instructions.
- 403
Your account is blocked, and you are not allowed to create or read bins. If you have any questions, please contact $email.
- 403
You are not allowed to see that page.
- 403
The author of this bin was blocked, and all bins created by them were removed for not following the terms and conditions of this website.
- 403
Terms & Conditions were not accepted.
- 404
The document was not found.
- 404
The user document was not found.
- 404
The user id was not found.
- 405
Method Not Allowed
- 413
Payload too large - maximum length of a document is 400 000 characters or less than 1mb in size.
- 500
Something went wrong.
- 500
An error occurred while getting the document.
- 500
Can't connect to the database.
- 500
An error occurred while adding the document.