<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/access-the-internet-archive-advanced-search-scrape-api-with-wayback-a-links-to-a-new-vignette-pkgdown-site/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://rud.is/b/2018/09/17/access-the-internet-archive-advanced-search-scrape-api-with-wayback-a-links-to-a-new-vignette-pkgdown-site/"> R – rud.is</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>The <a rel="nofollow" href="https://gitlab.com/hrbrmstr/wayback" target="_blank"><code>wayback</code><img alt="🔗" src="https://i0.wp.com/s.w.org/images/core/emoji/11/72x72/1f517.png?w=456&ssl=1" class="wp-smiley" data-recalc-dims="1"></a> package has had an update to more efficiently retrieve <a rel="nofollow" href="https://archive.readme.io/docs/memento" target="_blank">mementos</a> and added support for working with the <a rel="nofollow" href="https://archive.org/help/aboutsearch.htm" target="_blank">Internet Archive’s advanced search+scrape API</a>.</p>
<h3>Search/Scrape</h3>
<p>The search/scrape interface lets you examine the IA collections and download what you are after (programmatically). The main function is <code>ia_scrape()</code> but you can also paginate through results with the helper functions provided.</p>
<p>To demonstrate, let’s peruse the IA NASA collection and then grab one of the images. First, we need to search the collection then choose a target URL to retrieve and finally download it. The <code>identifier</code> is the key element to ensure we can retrieve the information about a particular collection.</p>
<pre><code>library(wayback)

nasa &lt;- ia_scrape(&quot;collection:nasa&quot;, count=100L)

tibble:::print.tbl_df(nasa)
## # A tibble: 100 x 3
##    identifier addeddate            title                                       
##    </code></pre>