BetaBetaProtected BetaexistsBetaitemOptional BetaitemsReadonly BetarssRSS feed URL for this collection
Protected BetasearchesReadonly BetasessionOptional BetasubReadonly BetaurlsItem URL types
Optional Readonly BetawikilinkA copyable link to the item, in MediaWiki format
Static BetagetBetaDate the item was created on
BetaThe primary data node the item is stored on
BetaThe secondary (backup) data node the item is stored on (unless stored on a solo node)
BetaThe item's absolute pathname (on both data nodes)
BetaFile metadata for this item
BetaTotal number of files in the item
BetaIndicates one or more tasks are red (halted due to error)
BetaBetaThe item is a collection
BetaThe item was darked and is unavailable
BetaThe time when the item was last modified
BetaTotal size in bytes of all files in the item
BetaItem Metadata
BetaThe item is not ready for downloading
BetaBetaIndicates one or more tasks are queued or running
BetaThe preferred server for reading the item's contents. Callers should use this node when constructing a URL
BetaOne or both servers are unavailable, that is, inaccessible for some reason (network problems, under service, etc.)
BetaSimplelist relations
BetaThe item is only stored on a single node (rare)
BetaBetaA list of data nodes currently available for accessing the item's contents
BetaDark the item.
The curation comment explaining reason for darking item
The task priority.
Submit your derive at a lower priority.
This option is helpful to get around rate-limiting.
Your task will more likely be accepted, but it might
not run for a long time. Note that you still may be
subject to rate-limiting. This is different than
priority in that it will allow you to possibly
avoid rate-limiting.
Optionalargs: Record<string, any>Additional arguments to submit with the task.
TODO
BetaDelete a review from the item
BetaDerive an item.
Task priority from 10 to -10 (default: 0)
OptionalremoveDerived: stringYou can use wildcards ("globs") to only remove some prior derivatives. For example, "" (typed without the quotation marks) specifies that all derivatives (in the item's top directory) are to be rebuilt. ".mp4" specifies that all ".mp4" deriviatives are to be rebuilt. "{.gif,thumbs/.jpg}" specifies that all GIF and thumbs are to be rebuilt.
Submit your derive at a lower priority. This option is helpful to get around rate-limiting. Your task will more likely be accepted, but it might not run for a long time. Note that you still may be subject to rate-limiting.
Additional optional args
Optionalheaders: HttpHeadersAdditional optional headers
ProtecteddoBetaDownload a file
Download file parameters
true if if all files have been downloaded successfully.
BetaSubmit a fixer task on an item.
The fixer operation(s) to run on the item. default: "noop"
The task priority.
Submit your derive at a lower priority.
This option is helpful to get around rate-limiting.
Your task will more likely be accepted, but it might
not run for a long time. Note that you still may be
subject to rate-limiting. This is different than
priority in that it will allow you to possibly
avoid rate-limiting.
Additional parameters to submit with the task.
Optionalheaders: HttpHeadersAdditional HTTP headers
BetaGet a list of all tasks for the item, pending and complete.
Query parameters, refer to Tasks API for available parameters.
A list of all tasks for the item, pending and complete.
BetaGet a list of pending catalog tasks for the item.
Optionalparams: IaGetTasksBasicParamsParams to send with your request.
A list of pending catalog tasks for the item.
BetaBetaGet a IaFile object for the named file.
File name or file metadata for the given file.
Betaoptions
OptionalexcludePattern?: string | string[]Exclude files matching the given glob pattern
Optionalfiles?: string | string[]Only return files matching the given filenames
Optionalformats?: string | string[]Only return files matching the given formats
OptionalglobPattern?: string | string[]Only return files matching the given glob pattern
OptionalonTheFly?: booleanInclude on-the-fly files (i.e. derivative EPUB)
BetaGet thumbnail URL for this item
URL
BetaGet long view counts
long view counts for this object
BetaRetrieves the currently authenticated user's review (if existing) for the this item. An item can only have one review for each user. If there is no review, this method returns undefined.
The review, or undefined if there is no review
IaApiError If unexpected HTTP response is returned
IaApiUnauthorizedError If the user does not have permissions for this call or is not authenticated
IaApiNotFoundError If there are no reviews by the user that is making this request
BetaBetaGet a list of completed catalog tasks for the item.
Optionalparams: IaGetTasksBasicParamsParams to send with your request.
A list of completed catalog tasks for the item.
BetaGet a summary of the item's pending tasks.
Optionalparams: Omit<Params to send with your request.
A summary of the item's pending tasks.
BetaCreate hash of this item based on the stringified metadata object.
MD5 hash as string
BetaCheck if there is any pending task for the item.
Optionalparams: Omit<Params to send with your request.
true if tasks are pending, otherwise false.
BetaCompare this item with another item, for sorting. Compares the 2 identifiers using String.localeCompare
Item to compare this item with
Return type of String.localeCompare which might differ based on the runtime
ProtectedmakeProtectedmakeBetaModify the metadata of an existing item on Archive.org.
Note: The Metadata Write API does not yet comply with the latest Json-Patch standard. It currently complies with JSON Patch version 02
Metadata used to update the item.
A Request if debug else a Response.
BetaRemove this item from a simplelist
BetaReturns a string representation of an object.
BetaUndark the item.
The curation comment explaining reason for undarking item
The task priority.
Submit your derive at a lower priority.
This option is helpful to get around rate-limiting.
Your task will more likely be accepted, but it might
not run for a long time. Note that you still may be
subject to rate-limiting. This is different than
priority in that it will allow you to possibly
avoid rate-limiting.
Optionalargs: Record<string, any>Additional arguments to submit with the task.
TODO
BetaUpload files to an item. The item will be created if it does not exist.
Single file or list of files to upload. Strings are assumed to be file paths. File objects can be supplied, which contain a name variable and a fileData variable. The fileData variable can be either a string or a Buffer
IA-S3 accessKey to use when making the given request.
Optionalheaders?: HttpHeadersOptionalmetadata?: IaBaseMetadataTypeOptionalretries?: numberOptionalretriesSleep?: numberIA-S3 secretKey to use when making the given request.
import {IaItem} from "internetarchive-ts";
const item = new IaItem('identifier');
const metadata = {'mediatype': 'image', 'creator': 'Jake Johnson'}
item.upload('/path/to/image.jpg', {metadata, queueDerive: false})
// [<Response [200]>]
// Uploading multiple files
const r1 = item.upload(['file1.txt', 'file2.txt']);
const r2 = item.upload([fileobj, fileobj2]);
const r3 = item.upload(('file1.txt', 'file2.txt'));
BetaUpload a single file to an item. The item will be created if it does not exist.
File or data to be uploaded. Filepath or file-like object.
IA-S3 accessKey to use when making the given request.
Optionalheaders?: HttpHeadersOptionalmetadata?: MOptionalretries?: numberOptionalretriesSleep?: numberIA-S3 secretKey to use when making the given request.
Static ReadonlyDEFAULT_
This class represents an archive.org collection.