4.0.0 • Published 5 years ago
@datafire/archive_search v4.0.0
@datafire/archive_search
Client library for Search Services
Installation and Usage
npm install --save @datafire/archive_searchlet archive_search = require('@datafire/archive_search').create();
.then(data => {
console.log(data);
});Description
API for Internet Archive's Search-related services
Actions
search.v1.fields.get
Fields that can be requested
archive_search.search.v1.fields.get({}, context)Input
- input
object- callback
string: Specifies a JavaScript function func, for a JSON-P response. When provided, results are wrapped ascallback(data), and the returned MIME type is application/javascript. This causes the caller to automatically run the func with the JSON results as its argument.
- callback
Output
- output
array- items Field
search.v1.organic.get
Return relevance-based results from search queries
archive_search.search.v1.organic.get({}, context)Input
- input
object- q
string: Lucene-type search query - field
string: Metadata field - size
integer: Number of query results to return - total_only
boolean: Request total only; do not return hits - callback
string: Specifies a JavaScript function func, for a JSON-P response. When provided, results are wrapped ascallback(data), and the returned MIME type is application/javascript. This causes the caller to automatically run the func with the JSON results as its argument.
- q
Output
- output OrganicResult
search.v1.scrape.get
Scrape search results from Internet Archive, allowing a scrolling cursor
archive_search.search.v1.scrape.get({}, context)Input
- input
object- q
string: Lucene-type search query - field
string: Metadata field - sort
string: sort collations - size
integer: Number of query results to return - cursor
string: Cursor for scrolling (used for subsequent calls) - total_only
boolean: Request total only; do not return hits - callback
string: Specifies a JavaScript function func, for a JSON-P response. When provided, results are wrapped ascallback(data), and the returned MIME type is application/javascript. This causes the caller to automatically run the func with the JSON results as its argument.
- q
Output
- output ScrapeResult
Definitions
Cursor
- Cursor
string: A scroll handle
Error
- Error
object- code
integer - message
string
- code
Field
- Field
string: The name of a field
Hit
- Hit
object: One item returned (object of fields and values)
OrganicResult
- OrganicResult
object: The result of a organic search request- count
integer: Number of results returned - items
array- items Hit
- total
integer: Approximate number of results meeting query
- count