You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ocr-space-api-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ocr-space-api-wrapper

Node.js wrapper for ocr.space APIs.

1.0.1
Source
npmnpm
Version published
Weekly downloads
9.5K
-40.77%
Maintainers
1
Weekly downloads
 
Created
Source

OCR Space Node.js API wrapper

Donate

Node.js wrapper for ocr.space APIs.

Install

npm i ocr-space-api-wrapper

Usage

const ocrSpace = require('ocr-space-api-wrapper')

async function main () {
  // Using the OCR.space default free token
  const response1 = await ocrSpace('http://dl.a9t9.com/ocrbenchmark/eng.png')
  // Using your personal token + a local file
  const response2 = await ocrSpace('/path/to/file.pdf', { apiKey: '<API_KEY_HERE>' })
  // Using your personal token + a base64image + custom language
  const response2 = await ocrSpace('data:image/png;base64,superLongStringHere...', { apiKey: '<API_KEY_HERE>', language: 'ita' })
}

Params

Input: string (required)

The input param specifies the input file (see example above). It can be one of the following:

  • a remote URL address;
  • a local file path;
  • a base64 image string.

Options: object (not required)

This param is an object with the following keys:

  • apiKey: your API key for ocr.space APIs.
  • ocrUrl: a different URL for oce.space APIs, for example when you purchase the PRO plans.
  • All other params as documented in the official website.

Response

Refer to the official website.

Bug or feedback

Please open a new issue.

Author

Keywords

ocr

FAQs

Package last updated on 09 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts