POST
/
documents
/
scrape
import Hyperspell from 'hyperspell';

const client = new Hyperspell({
  apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const documentStatus = await client.documents.addURL({ collection: 'collection', url: 'url' });

  console.log(documentStatus.id);
}

main();
{
  "id": 123,
  "status": "pending",
  "collection": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
collection
string
required

Name of the collection to add the document to. If the collection does not exist, it will be created.

url
string
required

Source URL of the document.

Response

200
application/json
Successful Response
id
integer
required
status
enum<string>
required
Available options:
pending,
processing,
completed,
failed
collection
string
required