How to set ocr language in the example php script


#1

I need to ocr Characters like öäü, so i need to set language to german.

In the php api demo script i found this GuzzleHttp Part:

$r = $client->request(‘POST’, ‘https://api.ocr.space/parse/image’,[
‘headers’ => [‘apiKey’ => ‘helloworld’],
‘multipart’ => [
[
‘name’ => ‘file’,
‘contents’ => $fileData
]
]
], [‘file’ => $fileData]);
$response = json_decode($r->getBody(),true);

Where there i have to add the language? =) Thank you.

Update: I think it´s not possible to send image and post fiels at the same time with this method, but i was able to find a solution that works perfectly with curl.


#2

Hi, here is a new PHP code snippet, it includes setting the OCR language:

Does this answer your question?