If you don't want to use the classic fetch
import { ofetch } from "ofetch";import OCRClient from "../dist/client";// https://github.com/unjs/ofetchconst client = new OCRClient({ fetchFn: ofetch.native,});const response = await client.scanByUrl( "https://repository-images.githubusercontent.com/450906609/c04b600b-5f0f-488b-820d-ffaeb1fde2d0",);console.log(response); Copy
import { ofetch } from "ofetch";import OCRClient from "../dist/client";// https://github.com/unjs/ofetchconst client = new OCRClient({ fetchFn: ofetch.native,});const response = await client.scanByUrl( "https://repository-images.githubusercontent.com/450906609/c04b600b-5f0f-488b-820d-ffaeb1fde2d0",);console.log(response);
Headers for interacting with Yandex API
The standard method for requesting the Yandex API, if necessary, you can override how it is done in the example
If you don't want to use the classic fetch
Example