[{"data":1,"prerenderedAt":943},["ShallowReactive",2],{"navigation_docs":3,"-guide-snapshots":88,"-guide-snapshots-surround":938},[4,40],{"title":5,"path":6,"stem":7,"children":8,"icon":39},"Guide","\u002Fguide","1.guide\u002F1.index",[9,11,15,19,23,27,31,35],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"Listing Captures","\u002Fguide\u002Fsnapshots","1.guide\u002F2.snapshots",{"title":16,"path":17,"stem":18},"Reading Captures","\u002Fguide\u002Fcontent","1.guide\u002F3.content",{"title":20,"path":21,"stem":22},"Comparing Versions","\u002Fguide\u002Fdiff","1.guide\u002F4.diff",{"title":24,"path":25,"stem":26},"Configuration","\u002Fguide\u002Fconfiguration","1.guide\u002F5.configuration",{"title":28,"path":29,"stem":30},"Agents","\u002Fguide\u002Fagents","1.guide\u002F6.agents",{"title":32,"path":33,"stem":34},"Custom Providers","\u002Fguide\u002Fcustom","1.guide\u002F7.custom",{"title":36,"path":37,"stem":38},"Explorer","\u002Fguide\u002Fexplorer","1.guide\u002F8.explorer","i-lucide-book-open",{"title":41,"path":42,"stem":43,"children":44,"icon":87},"Providers","\u002Fproviders","2.providers\u002F0.index",[45,47,51,55,59,63,67,71,75,79,83],{"title":46,"path":42,"stem":43},"Overview",{"title":48,"path":49,"stem":50},"Wayback Machine","\u002Fproviders\u002Fwayback","2.providers\u002F01.wayback",{"title":52,"path":53,"stem":54},"Arquivo.pt","\u002Fproviders\u002Farquivo","2.providers\u002F02.arquivo",{"title":56,"path":57,"stem":58},"Webarchiv Österreich","\u002Fproviders\u002Fwebarchiv","2.providers\u002F03.webarchiv",{"title":60,"path":61,"stem":62},"Archive.today","\u002Fproviders\u002Farchive-today","2.providers\u002F04.archive-today",{"title":64,"path":65,"stem":66},"Common Crawl","\u002Fproviders\u002Fcommoncrawl","2.providers\u002F05.commoncrawl",{"title":68,"path":69,"stem":70},"WebCite","\u002Fproviders\u002Fwebcite","2.providers\u002F06.webcite",{"title":72,"path":73,"stem":74},"Memento","\u002Fproviders\u002Fmemento","2.providers\u002F07.memento",{"title":76,"path":77,"stem":78},"Archive-It","\u002Fproviders\u002Farchive-it","2.providers\u002F08.archive-it",{"title":80,"path":81,"stem":82},"Conifer","\u002Fproviders\u002Fconifer","2.providers\u002F09.conifer",{"title":84,"path":85,"stem":86},"Perma.cc","\u002Fproviders\u002Fpermacc","2.providers\u002F10.permacc","i-lucide-library",{"id":89,"title":12,"body":90,"description":931,"extension":932,"links":933,"meta":934,"navigation":156,"path":13,"seo":936,"stem":14,"__hash__":937},"docs\u002F1.guide\u002F2.snapshots.md",{"type":91,"value":92,"toc":922},"minimark",[93,98,238,256,259,263,372,392,396,401,405,490,496,507,510,591,595,681,688,692,703,710,780,890,899,903,918],[94,95,97],"h2",{"id":96},"the-call","The call",[99,100,105],"pre",{"className":101,"code":102,"language":103,"meta":104,"style":104},"language-ts shiki shiki-themes vitesse-light vitesse-light vesper","import { createArchive, providers } from \"@agntn\u002Farchives\";\n\nconst archive = createArchive(providers.wayback());\nconst response = await archive.snapshots(\"example.com\", { limit: 50 });\n","ts","",[106,107,108,151,158,190],"code",{"__ignoreMap":104},[109,110,113,117,121,125,128,131,134,137,141,145,148],"span",{"class":111,"line":112},"line",1,[109,114,116],{"class":115},"sB1ot","import",[109,118,120],{"class":119},"sldxI"," {",[109,122,124],{"class":123},"sA8fy"," createArchive",[109,126,127],{"class":119},",",[109,129,130],{"class":123}," providers",[109,132,133],{"class":119}," }",[109,135,136],{"class":115}," from",[109,138,140],{"class":139},"sbwUx"," \"",[109,142,144],{"class":143},"sHyde","@agntn\u002Farchives",[109,146,147],{"class":139},"\"",[109,149,150],{"class":119},";\n",[109,152,154],{"class":111,"line":153},2,[109,155,157],{"emptyLinePlaceholder":156},true,"\n",[109,159,161,165,168,172,175,178,181,184,187],{"class":111,"line":160},3,[109,162,164],{"class":163},"s8Cdk","const",[109,166,167],{"class":123}," archive",[109,169,171],{"class":170},"sUeik"," =",[109,173,124],{"class":174},"shFES",[109,176,177],{"class":119},"(",[109,179,180],{"class":123},"providers",[109,182,183],{"class":119},".",[109,185,186],{"class":174},"wayback",[109,188,189],{"class":119},"());\n",[109,191,193,195,198,200,203,205,207,210,212,214,217,219,221,224,228,231,235],{"class":111,"line":192},4,[109,194,164],{"class":163},[109,196,197],{"class":123}," response",[109,199,171],{"class":170},[109,201,202],{"class":115}," await",[109,204,167],{"class":123},[109,206,183],{"class":119},[109,208,209],{"class":174},"snapshots",[109,211,177],{"class":119},[109,213,147],{"class":139},[109,215,216],{"class":143},"example.com",[109,218,147],{"class":139},[109,220,127],{"class":119},[109,222,223],{"class":119}," { ",[109,225,227],{"class":226},"sYv7f","limit",[109,229,230],{"class":119},": ",[109,232,234],{"class":233},"sZMfM","50",[109,236,237],{"class":119}," });\n",[239,240,241,243,244,247,248,251,252,255],"p",{},[106,242,209],{}," returns an ",[106,245,246],{},"ArchiveResponse",". ",[106,249,250],{},"getPages"," is the same call that returns ",[106,253,254],{},"ArchivedPage[]"," and throws when the response is not a success. Use the first when a failed provider is a normal outcome, the second when it is a bug.",[239,257,258],{},"A target can be a bare domain or a full URL. Wayback, Arquivo.pt, Archive-It and Common Crawl treat a domain as a prefix and list everything under it; Webarchiv Österreich and Perma.cc look up one exact URL, so give them the page you mean.",[94,260,262],{"id":261},"a-time-window","A time window",[99,264,266],{"className":101,"code":265,"language":103,"meta":104,"style":104},"await archive.snapshots(\"example.com\", { from: \"2019\", to: \"2019\" }); \u002F\u002F the whole of 2019\nawait archive.snapshots(\"example.com\", { from: \"2010-06-01\", to: \"20101231235959\" });\n",[106,267,268,324],{"__ignoreMap":104},[109,269,270,273,275,277,279,281,283,285,287,289,291,294,296,298,301,303,306,309,311,313,315,317,320],{"class":111,"line":112},[109,271,272],{"class":115},"await",[109,274,167],{"class":123},[109,276,183],{"class":119},[109,278,209],{"class":174},[109,280,177],{"class":119},[109,282,147],{"class":139},[109,284,216],{"class":143},[109,286,147],{"class":139},[109,288,127],{"class":119},[109,290,223],{"class":119},[109,292,293],{"class":226},"from",[109,295,230],{"class":119},[109,297,147],{"class":139},[109,299,300],{"class":143},"2019",[109,302,147],{"class":139},[109,304,305],{"class":119},", ",[109,307,308],{"class":226},"to",[109,310,230],{"class":119},[109,312,147],{"class":139},[109,314,300],{"class":143},[109,316,147],{"class":139},[109,318,319],{"class":119}," });",[109,321,323],{"class":322},"szOLe"," \u002F\u002F the whole of 2019\n",[109,325,326,328,330,332,334,336,338,340,342,344,346,348,350,352,355,357,359,361,363,365,368,370],{"class":111,"line":153},[109,327,272],{"class":115},[109,329,167],{"class":123},[109,331,183],{"class":119},[109,333,209],{"class":174},[109,335,177],{"class":119},[109,337,147],{"class":139},[109,339,216],{"class":143},[109,341,147],{"class":139},[109,343,127],{"class":119},[109,345,223],{"class":119},[109,347,293],{"class":226},[109,349,230],{"class":119},[109,351,147],{"class":139},[109,353,354],{"class":143},"2010-06-01",[109,356,147],{"class":139},[109,358,305],{"class":119},[109,360,308],{"class":226},[109,362,230],{"class":119},[109,364,147],{"class":139},[109,366,367],{"class":143},"20101231235959",[109,369,147],{"class":139},[109,371,237],{"class":119},[239,373,374,376,377,379,380,383,384,387,388,391],{},[106,375,293],{}," and ",[106,378,308],{}," accept Wayback digits (",[106,381,382],{},"YYYY"," through ",[106,385,386],{},"YYYYMMDDhhmmss",") or ISO 8601 dates. Both edges are inclusive, and a partial stamp covers the period it names: ",[106,389,390],{},"to: \"2019\""," reaches the last second of that year. Providers whose index can narrow the query do so; the rest are filtered after the fact, so the window holds when every archive is asked at once.",[94,393,395],{"id":394},"limits","Limits",[239,397,398,400],{},[106,399,227],{}," caps the pages one call returns. On a merged listing it caps the merged list, after every provider answered and the pages were sorted newest first. A provider that lists oldest first, which is what the Wayback CDX does by default, can contribute nothing to a short merged listing when other archives hold newer captures. Ask that provider on its own, or narrow the window, when you need its early history.",[94,402,404],{"id":403},"every-archive-at-once","Every archive at once",[99,406,408],{"className":101,"code":407,"language":103,"meta":104,"style":104},"const archive = createArchive(providers.all({ concurrency: 3, timeout: 10_000, retries: 1 }));\nconst response = await archive.snapshots(\"example.com\");\n",[106,409,410,463],{"__ignoreMap":104},[109,411,412,414,416,418,420,422,424,426,429,432,435,437,440,442,445,447,450,452,455,457,460],{"class":111,"line":112},[109,413,164],{"class":163},[109,415,167],{"class":123},[109,417,171],{"class":170},[109,419,124],{"class":174},[109,421,177],{"class":119},[109,423,180],{"class":123},[109,425,183],{"class":119},[109,427,428],{"class":174},"all",[109,430,431],{"class":119},"({ ",[109,433,434],{"class":226},"concurrency",[109,436,230],{"class":119},[109,438,439],{"class":233},"3",[109,441,305],{"class":119},[109,443,444],{"class":226},"timeout",[109,446,230],{"class":119},[109,448,449],{"class":233},"10_000",[109,451,305],{"class":119},[109,453,454],{"class":226},"retries",[109,456,230],{"class":119},[109,458,459],{"class":233},"1",[109,461,462],{"class":119}," }));\n",[109,464,465,467,469,471,473,475,477,479,481,483,485,487],{"class":111,"line":153},[109,466,164],{"class":163},[109,468,197],{"class":123},[109,470,171],{"class":170},[109,472,202],{"class":115},[109,474,167],{"class":123},[109,476,183],{"class":119},[109,478,209],{"class":174},[109,480,177],{"class":119},[109,482,147],{"class":139},[109,484,216],{"class":143},[109,486,147],{"class":139},[109,488,489],{"class":119},");\n",[239,491,492,495],{},[106,493,494],{},"providers.all()"," queries Wayback, Arquivo.pt, Webarchiv Österreich, Archive.today, Common Crawl and WebCite. Memento is not in it because MemGator already aggregates several of those archives and would double the requests; Archive-It, Conifer and Perma.cc need a collection, a user, or a key before they can answer.",[239,497,498,499,502,503,506],{},"Pages that match on URL and timestamp across providers are deduplicated. Each page keeps ",[106,500,501],{},"_meta.provider",", so a merged list can still be split by source. The landing panel does that with ",[106,504,505],{},"groupByProvider"," in the docs app.",[239,508,509],{},"Any archive can grow after creation:",[99,511,513],{"className":101,"code":512,"language":103,"meta":104,"style":104},"const archive = createArchive(providers.wayback());\nawait archive.use(providers.archiveToday());\nawait archive.useAll([providers.commoncrawl(), providers.memento()]);\n",[106,514,515,535,557],{"__ignoreMap":104},[109,516,517,519,521,523,525,527,529,531,533],{"class":111,"line":112},[109,518,164],{"class":163},[109,520,167],{"class":123},[109,522,171],{"class":170},[109,524,124],{"class":174},[109,526,177],{"class":119},[109,528,180],{"class":123},[109,530,183],{"class":119},[109,532,186],{"class":174},[109,534,189],{"class":119},[109,536,537,539,541,543,546,548,550,552,555],{"class":111,"line":153},[109,538,272],{"class":115},[109,540,167],{"class":123},[109,542,183],{"class":119},[109,544,545],{"class":174},"use",[109,547,177],{"class":119},[109,549,180],{"class":123},[109,551,183],{"class":119},[109,553,554],{"class":174},"archiveToday",[109,556,189],{"class":119},[109,558,559,561,563,565,568,571,573,575,578,581,583,585,588],{"class":111,"line":160},[109,560,272],{"class":115},[109,562,167],{"class":123},[109,564,183],{"class":119},[109,566,567],{"class":174},"useAll",[109,569,570],{"class":119},"([",[109,572,180],{"class":123},[109,574,183],{"class":119},[109,576,577],{"class":174},"commoncrawl",[109,579,580],{"class":119},"(),",[109,582,130],{"class":123},[109,584,183],{"class":119},[109,586,587],{"class":174},"memento",[109,589,590],{"class":119},"()]);\n",[94,592,594],{"id":593},"performance-options","Performance options",[596,597,598,614],"table",{},[599,600,601],"thead",{},[602,603,604,608,611],"tr",{},[605,606,607],"th",{},"Option",[605,609,610],{},"Default",[605,612,613],{},"Meaning",[615,616,617,629,642,654,665],"tbody",{},[602,618,619,624,626],{},[620,621,622],"td",{},[106,623,434],{},[620,625,439],{},[620,627,628],{},"Providers queried at the same time",[602,630,631,636,639],{},[620,632,633],{},[106,634,635],{},"batchSize",[620,637,638],{},"20",[620,640,641],{},"Items processed per batch inside a provider",[602,643,644,648,651],{},[620,645,646],{},[106,647,444],{},[620,649,650],{},"10 000 ms",[620,652,653],{},"Per request",[602,655,656,660,662],{},[620,657,658],{},[106,659,454],{},[620,661,459],{},[620,663,664],{},"Retries after a failed request",[602,666,667,672,674],{},[620,668,669],{},[106,670,671],{},"signal",[620,673],{},[620,675,676,677,680],{},"An ",[106,678,679],{},"AbortSignal"," that cancels the requests still running",[239,682,683,684,687],{},"They can be set on the factory, on ",[106,685,686],{},"createArchive",", or per call; the nearest one wins.",[94,689,691],{"id":690},"when-a-provider-cannot-answer","When a provider cannot answer",[239,693,694,695,698,699,702],{},"Not every provider implements every operation. WebCite has no endpoint that lists a domain, Perma.cc lists only what your key can see. Instead of an empty array, such a provider returns ",[106,696,697],{},"success: false"," with ",[106,700,701],{},"unsupported: true"," and a reason.",[239,704,705,706,709],{},"In a merged response the unsupported providers always appear under ",[106,707,708],{},"_meta.unsupportedProviders",". The flags at the top level follow stricter rules:",[596,711,712,734],{},[599,713,714],{},[602,715,716,719,724,729],{},[605,717,718],{},"Scenario",[605,720,721],{},[106,722,723],{},"success",[605,725,726],{},[106,727,728],{},"error",[605,730,731],{},[106,732,733],{},"unsupported",[615,735,736,750,765],{},[602,737,738,741,746,748],{},[620,739,740],{},"Some providers succeed, others are unsupported",[620,742,743],{},[106,744,745],{},"true",[620,747],{},[620,749],{},[602,751,752,755,760,763],{},[620,753,754],{},"Some fail, some are unsupported, none succeed",[620,756,757],{},[106,758,759],{},"false",[620,761,762],{},"joined errors",[620,764],{},[602,766,767,770,774,776],{},[620,768,769],{},"Every queried provider is unsupported",[620,771,772],{},[106,773,759],{},[620,775],{},[620,777,778],{},[106,779,745],{},[99,781,783],{"className":101,"code":782,"language":103,"meta":104,"style":104},"const response = await createArchive(providers.all()).snapshots(\"example.com\");\n\nif (!response.success && response.unsupported) {\n  \u002F\u002F nobody could even try\n}\nresponse._meta?.errors; \u002F\u002F [\"commoncrawl: [GET] … fetch failed\"], when a provider failed\n",[106,784,785,820,824,857,862,868],{"__ignoreMap":104},[109,786,787,789,791,793,795,797,799,801,803,805,808,810,812,814,816,818],{"class":111,"line":112},[109,788,164],{"class":163},[109,790,197],{"class":123},[109,792,171],{"class":170},[109,794,202],{"class":115},[109,796,124],{"class":174},[109,798,177],{"class":119},[109,800,180],{"class":123},[109,802,183],{"class":119},[109,804,428],{"class":174},[109,806,807],{"class":119},"()).",[109,809,209],{"class":174},[109,811,177],{"class":119},[109,813,147],{"class":139},[109,815,216],{"class":143},[109,817,147],{"class":139},[109,819,489],{"class":119},[109,821,822],{"class":111,"line":153},[109,823,157],{"emptyLinePlaceholder":156},[109,825,826,829,832,835,838,840,842,845,847,849,851,854],{"class":111,"line":160},[109,827,828],{"class":115},"if",[109,830,831],{"class":119}," (",[109,833,834],{"class":163},"!",[109,836,837],{"class":123},"response",[109,839,183],{"class":119},[109,841,723],{"class":123},[109,843,844],{"class":163}," &&",[109,846,197],{"class":123},[109,848,183],{"class":119},[109,850,733],{"class":123},[109,852,853],{"class":119},")",[109,855,856],{"class":119}," {\n",[109,858,859],{"class":111,"line":192},[109,860,861],{"class":322},"  \u002F\u002F nobody could even try\n",[109,863,865],{"class":111,"line":864},5,[109,866,867],{"class":119},"}\n",[109,869,871,873,875,878,881,884,887],{"class":111,"line":870},6,[109,872,837],{"class":123},[109,874,183],{"class":119},[109,876,877],{"class":123},"_meta",[109,879,880],{"class":119},"?.",[109,882,883],{"class":123},"errors",[109,885,886],{"class":119},";",[109,888,889],{"class":322}," \u002F\u002F [\"commoncrawl: [GET] … fetch failed\"], when a provider failed\n",[239,891,892,894,895,898],{},[106,893,250],{}," throws ",[106,896,897],{},"UnsupportedOperationError",", with the provider records attached, when the whole call was unsupported. That is a structural answer, distinct from a fetch that failed.",[94,900,902],{"id":901},"caching","Caching",[239,904,905,906,909,910,913,914,183],{},"Every listing is cached in memory for seven days by default, keyed by provider, target and the options that change the result set. ",[106,907,908],{},"fromCache: true"," marks a replayed response. Turn it off per call with ",[106,911,912],{},"{ cache: false }",", or set a driver and TTL once through ",[915,916,917],"a",{"href":25},"configuration",[919,920,921],"style",{},"html pre.shiki code .sB1ot, html code.shiki .sB1ot{--shiki-light:#1E754F;--shiki-default:#1E754F;--shiki-dark:#A0A0A0}html pre.shiki code .sldxI, html code.shiki .sldxI{--shiki-light:#999999;--shiki-default:#999999;--shiki-dark:#FFF}html pre.shiki code .sA8fy, html code.shiki .sA8fy{--shiki-light:#B07D48;--shiki-default:#B07D48;--shiki-dark:#FFF}html pre.shiki code .sbwUx, html code.shiki .sbwUx{--shiki-light:#B5695977;--shiki-default:#B5695977;--shiki-dark:#99FFE4}html pre.shiki code .sHyde, html code.shiki .sHyde{--shiki-light:#B56959;--shiki-default:#B56959;--shiki-dark:#99FFE4}html pre.shiki code .s8Cdk, html code.shiki .s8Cdk{--shiki-light:#AB5959;--shiki-default:#AB5959;--shiki-dark:#A0A0A0}html pre.shiki code .sUeik, html code.shiki .sUeik{--shiki-light:#999999;--shiki-default:#999999;--shiki-dark:#A0A0A0}html pre.shiki code .shFES, html code.shiki .shFES{--shiki-light:#59873A;--shiki-default:#59873A;--shiki-dark:#FFC799}html pre.shiki code .sYv7f, html code.shiki .sYv7f{--shiki-light:#998418;--shiki-default:#998418;--shiki-dark:#FFF}html pre.shiki code .sZMfM, html code.shiki .sZMfM{--shiki-light:#2F798A;--shiki-default:#2F798A;--shiki-dark:#FFC799}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .szOLe, html code.shiki .szOLe{--shiki-light:#A0ADA0;--shiki-default:#A0ADA0;--shiki-dark:#8B8B8B94}",{"title":104,"searchDepth":153,"depth":153,"links":923},[924,925,926,927,928,929,930],{"id":96,"depth":153,"text":97},{"id":261,"depth":153,"text":262},{"id":394,"depth":153,"text":395},{"id":403,"depth":153,"text":404},{"id":593,"depth":153,"text":594},{"id":690,"depth":153,"text":691},{"id":901,"depth":153,"text":902},"Windows, limits, asking every archive at once, and what a provider says when it cannot answer.","md",null,{"icon":935},"i-lucide-history",{"title":12,"description":931},"yc59hakkMAQVQO0wqZix4vGD-oFUcS_wteJ49HgOxTE",[939,941],{"title":10,"path":6,"stem":7,"description":940,"children":-1},"Install the package, ask one archive for a domain, and read a capture in a dozen lines.",{"title":16,"path":17,"stem":18,"description":942,"children":-1},"How a timestamp becomes a capture, what comes back, and which archives can serve a body at all.",1788446779051]