Scraping API
You can scrape our website, but your IP will most likely get blocked to prevent unnecessary load on our servers. We therefore offer this scraping API service for people who want to scrape our platform without getting blocked.
This is the Pastebin scraping API documentation page. Here you can find all the information you need to get started with our scraping API. If you have questions, feel free to contact us.
Your Account & Whitelisted IP
Our scraping API is only available for LIFETIME PRO members, and only for those who have their IP whitelisted.
Your whitelisted IP is: NOT SET
Your current IP is: 207.241.225.159
Only 1 IP can be whitelisted per Pastebin PRO account. You can update your IP as often as you like, and changes are effective immediately. Both IPv4 and IPv6 IP's are accepted. It depends on your network configuation which one you have to whitelist.
Important: Please make sure you ONLY fetch the scraping API endpoints listed on this page. If you scrape our website (including /raw/* pages) with your whitelisted IP, you will get blocked.
IMPORTANT: TO WHITELIST YOUR IP, YOU NEED TO BE A LIFETIME PRO MEMBER! UPGRADE TO A LIFETIME PRO ACCOUNT, THEN YOU CAN WHITELIST YOUR IP ON THIS PAGE!
Your account status is: NOT LOGGED INYour whitelisted IP is: NOT SET
Your current IP is: 207.241.225.159
Only 1 IP can be whitelisted per Pastebin PRO account. You can update your IP as often as you like, and changes are effective immediately. Both IPv4 and IPv6 IP's are accepted. It depends on your network configuation which one you have to whitelist.
Important: Please make sure you ONLY fetch the scraping API endpoints listed on this page. If you scrape our website (including /raw/* pages) with your whitelisted IP, you will get blocked.
Request Limits
Your whitelisted IP should not run into any issues as long as you don't abuse our service. We recommend not making more than 1 request per second, as there really is no need to do so. Going over 1 request per second won't get you blocked, but if we see excessive unnecessary scraping, we might take action.
Recommended Scraping Logic
If you are trying to read ALL new public pastes, we recommend that you list 1x per minute the 100 most recent pastes. Store all those ID's/Keys locally somewhere, then fetch all those pastes and process the information however you like.
We urge you not to re-fetch pastes unnecessarily, as the data doesn't change quickly. Having some kind of local database system, which prevents unnecessary re-fetches is highly recommended! It lowers the load on both your own and our servers.
We urge you not to re-fetch pastes unnecessarily, as the data doesn't change quickly. Having some kind of local database system, which prevents unnecessary re-fetches is highly recommended! It lowers the load on both your own and our servers.
Request Most Recent Pastes
Due to caching, items listed here are shown with a 2 minute delay.
To fetch the most recent pastes, query the link below. It's a pretty standard JSON output. You can limit the results by adding ?limit=10 for example. The max allowed value there is 250. Default is 50. You can only reach this link with your whitelisted IP!
https://scrape.pastebin.com/api_scraping.php
Below is an example output:
[
{
"scrape_url": "https://scrape.pastebin.com/api_scrape_item.php?i=0CeaNm8Y",
"full_url": "https://pastebin.com/0CeaNm8Y",
"date": "1442911802",
"key": "0CeaNm8Y",
"size": "890",
"expire": "1442998159",
"title": "Once we all know when we goto function",
"syntax": "java",
"user": "admin"
},
{
"scrape_url": "https://scrape.pastebin.com/api_scrape_item.php?i=8sUIsf34",
"full_url": "https://pastebin.com/8sUIsf34",
"date": "1442911665",
"key": "8sUIsf34",
"size": "250",
"expire": "0",
"title": "master / development delete restriction",
"syntax": "php",
"user": ""
}
]
You can also add ?lang=php for example, if you just want to grab results from a certain language. We support well over 200 languages. Click here to find all the supported languages. Always include the value on the left hand side of that list to query it.
Request RAW Paste Data
To fetch the RAW data of any paste, you can query the URL below. Replace UNIQUE_PASTE_KEY with the key of the paste that you want to fetch. You can only reach this link with your whitelisted IP! Do not scrape /raw/* pages, as you will get blocked.
https://scrape.pastebin.com/api_scrape_item.php?i=UNIQUE_PASTE_KEY
Request Paste Metadata
To fetch the metadata of any paste, you can query the URL below. Replace UNIQUE_PASTE_KEY with the key of the paste that you want to fetch. You can only reach this link with your whitelisted IP!
https://scrape.pastebin.com/api_scrape_item_meta.php?i=UNIQUE_PASTE_KEY
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.