CINXE.COM

Pastebin.com - Scraping API

<!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, initial-scale=0.75, maximum-scale=5.0, user-scalable=yes" /> <script async src="https://www.googletagmanager.com/gtag/js?id=G-S72LBY47R8"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', "G-S72LBY47R8"); </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Pastebin.com - Scraping API</title> <link rel="shortcut icon" href="/favicon.ico" /> <meta name="description" content="Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time." /> <meta property="og:description" content="Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time." /> <meta property="fb:app_id" content="231493360234820" /> <meta property="og:title" content="Pastebin.com - Scraping API" /> <meta property="og:type" content="article" /> <meta property="og:url" content="https://pastebin.com/doc_scraping_api" /> <meta property="og:image" content="https://pastebin.com/i/facebook.png" /> <meta property="og:site_name" content="Pastebin" /> <meta name="google-site-verification" content="jkUAIOE8owUXu8UXIhRLB9oHJsWBfOgJbZzncqHoF4A" /> <link rel="canonical" href="https://pastebin.com/doc_scraping_api" /> <meta name="csrf-param" content="_csrf-frontend"> <meta name="csrf-token" content="w133cS2rUuUIcdHWq8pKFZLRf2M_rKkA0_cCudnY4jq0N6Ekatsqtjsms7zbjDog-ORIJWCV4Ve5wU346KuaZQ=="> <link href="/assets/c80611c4/css/bootstrap.min.css" rel="stylesheet"> <link href="/assets/72fc434d/dist/bootstrap-tagsinput.css" rel="stylesheet"> <link href="/themes/pastebin/css/vendors.bundle.css?30d6ece6979ee0cf5531" rel="stylesheet"> <link href="/themes/pastebin/css/app.bundle.css?30d6ece6979ee0cf5531" rel="stylesheet"> </head> <body class="night-auto " data-pr="" data-pa="x2xy94pJ" data-sar="1" data-abd="1" data-bd="1"> <svg style="height: 0; width: 0; position: absolute; visibility: hidden" xmlns="http://www.w3.org/2000/svg"> <symbol id="add" viewBox="0 0 1024 1024"><path fill="#ccc" d="M512 16C238 16 16 238 16 512s222 496 496 496 496-222 496-496S786 16 512 16z m288 552c0 13.2-10.8 24-24 24h-184v184c0 13.2-10.8 24-24 24h-112c-13.2 0-24-10.8-24-24v-184h-184c-13.2 0-24-10.8-24-24v-112c0-13.2 10.8-24 24-24h184v-184c0-13.2 10.8-24 24-24h112c13.2 0 24 10.8 24 24v184h184c13.2 0 24 10.8 24 24v112z"/></symbol> <symbol id="search" viewBox="0 0 512 512"><path fill="#ccc" d="M354.2,216c0-38.2-13-70.7-40-97.7c-27-27-59.6-40-97.7-40s-70.7,13-97.7,40s-40,59.6-40,97.7 s13,70.7,40,97.7s59.6,40,97.7,40s70.7-13,97.7-40C340.2,285.8,354.2,253.2,354.2,216z M511.5,472c0,10.2-3.7,19.5-12.1,27.9 c-8.4,8.4-16.8,12.1-27.9,12.1c-11.2,0-20.5-3.7-27.9-12.1L339.3,393.8c-37.2,26.1-78.2,38.2-122.9,38.2 c-29.8,0-57.7-5.6-83.8-16.8c-27-11.2-50.3-27-68.9-46.5s-34.4-42.8-46.5-68.9C6.1,272.8,0.5,244.8,0.5,216s5.6-57.7,16.8-83.8 c11.2-27,27-50.3,46.5-68.9s42.8-34.4,68.9-46.5C159.7,5.6,187.6,0,216.4,0s57.7,5.6,83.8,16.8c27,11.2,50.3,27,68.9,46.5 c18.6,19.5,34.4,42.8,46.5,68.9c11.2,27,16.8,54.9,16.8,83.8c0,44.7-13,85.6-38.2,122.9L499.4,444 C507.8,451.5,511.5,460.8,511.5,472z"/></g></symbol> </svg> <div class="wrap"> <div class="header"> <div class="container"> <div class="header__container"> <div class="header__left"> <a class="header__logo" href="/"> Pastebin </a> <div class="header__links h_1024"> <a href="/doc_api">API</a> <a href="/tools">tools</a> <a href="/faq">faq</a> </div> <a class="header__btn" href="/"> <span>paste</span> </a> <div class="header__search"> <form id="w0" class="search_form" action="https://pastebin.com/search" method="get"> <input type="text" id="q" class="search_input" name="q" maxlength="128" placeholder="Search..."> <button type="submit" class="search_btn" aria-label="Search"><svg class="icon search"><use xlink:href="#search"></use></svg></button> </form> </div> </div> <div class="header__right"> <div class="header_sign"> <a href="/login" class="btn-sign sign-in">Login</a> <a href="/signup" class="btn-sign sign-up">Sign up</a> </div> </div> </div> </div> </div> <div class="container"> <div class="content"> <div class="page -top -right"> <div class="content__title">Scraping API</div> <div class="content__text"> <div class="notice -no-margin"> 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. </div> </div> <div class="content__text"> 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 <a href="/contact">contact us</a>. <div style="margin: 8px 0 0 30px"> 1. <a href="#1">Your Whitelisted IP</a><br> 2. <a href="#2">Request Limits</a><br> 3. <a href="#3">Recommended Scraping Logic</a><br> 4. <a href="#4">Request Most Recent Pastes</a><br> 5. <a href="#5">Request RAW Paste Data</a><br> 6. <a href="#6">Request Paste Metadata</a> </div> </div> <!-- --> <div id="1" class="anchor"></div> <div class="content__sub_title">Your Account &amp; Whitelisted IP</div> <div class="content__text"> 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 <a href="mailto:sales@pastebin.com">sales@pastebin.com</a> for more information.<br><br> <div class="error"><b>IMPORTANT:</b> TO WHITELIST YOUR IP, YOU NEED TO BE A PRO MEMBER! <a href="/pro">UPGRADE TO A PRO ACCOUNT</a>, THEN YOU CAN WHITELIST YOUR IP ON THIS PAGE!</div> Your account status is: <b> <span class="red">NOT LOGGED IN</span> </b><br> Your whitelisted IP is: <b> <span class="red">NOT SET</span> </b><br> Your current IP is: <b>8.222.208.146</b><br> <br> 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.<br><br> <b>Important:</b> 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. </div> <!-- --> <div id="2" class="anchor"></div> <div class="content__sub_title">Request Limits</div> <div class="content__text"> 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. </div> <!-- --> <div id="3" class="anchor"></div> <div class="content__sub_title">Recommended Scraping Logic</div> <div class="content__text"> 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. <br><br> 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. </div> <!-- --> <div id="4" class="anchor"></div> <div class="content__sub_title">Request Most Recent Pastes</div> <div class="content__text"> <div class="notice">Due to caching, items listed here are shown with a 2 minute delay.</div> To fetch the most recent pastes, query the link below. It's a pretty standard JSON output. You can limit the results by adding <span class="mark">?limit=10</span> for example. The max allowed value there is <span class="mark">250</span>. Default is <span class="mark">50</span>. You can only reach this link with your whitelisted IP! <div class="code_box boostit">https://scrape.pastebin.com/api_scraping.php</div> Below is an example output: <div class="code_box">[ { "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": "" } ] </div> You can also add <span class="mark">?lang=php</span> for example, if you just want to grab results from a certain language. We support well over 200 languages. <a href="/doc_api#5">Click here</a> to find all the supported languages. Always include the value on the left hand side of that list to query it. </div> <!-- --> <div id="5" class="anchor"></div> <div class="content__sub_title">Request RAW Paste Data</div> <div class="content__text"> To fetch the RAW data of any paste, you can query the URL below. Replace <span class="mark">UNIQUE_PASTE_KEY</span> 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. <div class="code_box boostit">https://scrape.pastebin.com/api_scrape_item.php?i=UNIQUE_PASTE_KEY</div> </div> <!-- --> <div id="6" class="anchor"></div> <div class="content__sub_title">Request Paste Metadata</div> <div class="content__text"> To fetch the metadata of any paste, you can query the URL below. Replace <span class="mark">UNIQUE_PASTE_KEY</span> with the key of the paste that you want to fetch. You can only reach this link with your whitelisted IP! <div class="code_box boostit">https://scrape.pastebin.com/api_scrape_item_meta.php?i=UNIQUE_PASTE_KEY</div> </div> </div> <div style="clear: both;"></div> </div> <div class="sidebar h_1024"> <div class="sidebar__title"> <a href="/archive">Public Pastes</a> </div> <ul class="sidebar__menu"> <li> <a href="/L1fRmD3W">stocker.lua</a> <div class="details"> Lua | 41 sec ago | 6.06 KB </div> </li> <li> <a href="/4aw9zkaW">⭐️ EARN $500 INSTANTLY⭐ NB</a> <div class="details"> JavaScript | 4 min ago | 0.17 KB </div> </li> <li> <a href="/x60jQ4Q4">⭐ FREE giftcards method⭐ TO</a> <div class="details"> JavaScript | 5 min ago | 0.17 KB </div> </li> <li> <a href="/7Cx76EiL">bronze_ingot_stock.json</a> <div class="details"> JSON | 8 min ago | 0.49 KB </div> </li> <li> <a href="/bEuMgDG2">⭐ FREE giftcards method ON</a> <div class="details"> JavaScript | 12 min ago | 0.17 KB </div> </li> <li> <a href="/AGKV14Xu">⭐ Binance Account hack 3B</a> <div class="details"> JavaScript | 13 min ago | 0.17 KB </div> </li> <li> <a href="/MwhHfPtT">⭐️ EARN $500 INSTANTLY⭐ NB</a> <div class="details"> JavaScript | 21 min ago | 0.17 KB </div> </li> <li> <a href="/M4PjF7dW">⭐️ EARN $500 INSTANTLY KE</a> <div class="details"> JavaScript | 22 min ago | 0.17 KB </div> </li> </ul> <div class="sidebar__sticky -on"> </div> </div> </div> </div> <div class="top-footer"> <a class="icon-link -size-24-24 -chrome" href="/tools#chrome" title="Google Chrome Extension"></a> <a class="icon-link -size-24-24 -firefox" href="/tools#firefox" title="Firefox Extension"></a> <a class="icon-link -size-24-24 -iphone" href="/tools#iphone" title="iPhone/iPad Application"></a> <a class="icon-link -size-24-24 -windows" href="/tools#windows" title="Windows Desktop Application"></a> <a class="icon-link -size-24-24 -android" href="/tools#android" title="Android Application"></a> <a class="icon-link -size-24-24 -macos" href="/tools#macos" title="MacOS X Widget"></a> <a class="icon-link -size-24-24 -opera" href="/tools#opera" title="Opera Extension"></a> <a class="icon-link -size-24-24 -unix" href="/tools#pastebincl" title="Linux Application"></a> </div> <footer class="footer"> <div class="container"> <div class="footer__container"> <div class="footer__left"> <a href="/">create new paste</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/languages">syntax languages</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/archive">archive</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/faq">faq</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/tools">tools</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/night_mode">night mode</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/doc_api">api</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/doc_scraping_api">scraping api</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/news">news</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/pro" class="pro">pro</a> <br> <a href="/doc_privacy_statement">privacy statement</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/doc_cookies_policy">cookies policy</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/doc_terms_of_service">terms of service</a><span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/doc_security_disclosure">security disclosure</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/dmca">dmca</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/report-abuse">report abuse</a> <span class="footer__devider">&nbsp;/&nbsp;</span> <a href="/contact">contact</a> <br> <br> <span class="footer__bottom h_800"> By using Pastebin.com you agree to our <a href="/doc_cookies_policy">cookies policy</a> to enhance your experience. <br> Site design &amp; logo &copy; 2024 Pastebin</span> </div> <div class="footer__right h_1024"> <a class="icon-link -size-40-40 -facebook-circle" href="https://facebook.com/pastebin" rel="nofollow" title="Like us on Facebook" target="_blank"></a> <a class="icon-link -size-40-40 -twitter-circle" href="https://twitter.com/pastebin" rel="nofollow" title="Follow us on Twitter" target="_blank"></a> </div> </div> </div> </footer> <div class="popup-container"> <div class="popup-box -cookies" data-name="l2c_1"> We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the <a href="/doc_cookies_policy">Cookies Policy</a>. &nbsp;<span class="cookie-button js-close-cookies">OK, I Understand</span> </div> <div class="popup-box -pro" data-name="l2c_2_pg"> <div class="pro-promo-img"> <a href="/signup" aria-label="Sign Up"> <img src="/themes/pastebin/img/hello.webp" alt=""/> </a> </div> <div class="pro-promo-text"> Not a member of Pastebin yet?<br/> <a href="/signup"><b>Sign Up</b></a>, it unlocks many cool features! </div> <div class="close js-close-pro-guest" title="Close Me">&nbsp;</div> </div> </div> <span class="cd-top"></span> <script src="/assets/9ce1885/jquery.min.js"></script> <script src="/assets/f04f76b8/yii.js"></script> <script src="/assets/72fc434d/dist/bootstrap-tagsinput.js"></script> <script> const POST_EXPIRATION_NEVER = 'N'; const POST_EXPIRATION_BURN = 'B'; const POST_STATUS_PUBLIC = '0'; const POST_STATUS_UNLISTED = '1'; </script> <script src="/themes/pastebin/js/vendors.bundle.js?30d6ece6979ee0cf5531"></script> <script src="/themes/pastebin/js/app.bundle.js?30d6ece6979ee0cf5531"></script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10