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 "PRO" members, and only for those who have their IP whitelisted. “PRO” accounts are enabled with Scraping API and to collect only records with syntax highlighting. Enterprise API offers more robust access, including the removal of this limitation and for commercial purposes with additional features. Please contact sales@pastebin.com for more information.

IMPORTANT: TO WHITELIST YOUR IP, YOU NEED TO BE A PRO MEMBER! UPGRADE TO A PRO ACCOUNT, THEN YOU CAN WHITELIST YOUR IP ON THIS PAGE!
Your account status is: NOT LOGGED IN
Your whitelisted IP is: NOT SET
Your current IP is: 18.118.226.167

Only 1 IP can be whitelisted per Pastebin PRO account. You can update your IP as often as you like, and changes are effective within a minute. Both IPv4 and IPv6 IP's are accepted. It depends on your network configuration 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.
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