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.

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.

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!

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!