Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (11 sloc) 9.19 KB
Rem Example cURL calls fpr the OCR API at https://ocr.space/Parse/Image
Rem cURL main site: https://curl.haxx.se/download.html
Rem cURL for Windows: http://www.confusedbycode.com/curl/
Rem (1) Submitting the file via Base64 (jpg image)
Rem Text on image is "Google Search"
curl -H "apikey:helloworld" --form "base64Image=data:image/jpeg;base64,/9j/4AAQSkZJRgABAAEAYABgAAD//gAfTEVBRCBUZWNobm9sb2dpZXMgSW5jLiBWMS4wMQD/2wCEAAUFBQgFCAwHBwwMCQkJDA0MDAwMDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0BBQgICgcKDAcHDA0MCgwNDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDf/EAaIAAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKCwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoLEAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+foRAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/A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7yaceZr3Xy3soq1VLyeIcHabrScXe16Xtm5qD0S542lo1zrm1blZ7M3h+01PUtGS3024j0qJ9ULw3MMnlKJI49haGRn+zwSuCYYJVhxjAgTgVKXx8+v+zpRu7tP2qsnLXmmo6q0pOKtqnG0ZbtBqGjdem3ZWulSqczS0aje0ZOyTd91O8uy+G0FzZ6Bb296ksUsLXCBJldXWNbmUQjD4YKIgmzPVNpHGKuUnJU5S+J0qXN35/Zx5r/3ua/N1ve+oSSjUqqGkPaT5bbcrd/d6Wu3a2nY7vNZgNtf+PiT/rnH/wChS0AadAFDUv8AUj/rpF/6NSgCLOKADOKADOKADOKADOKAOYvPB2k39099PAWmlMRlAlmSKYwnMRngSRYJzGcbDNG+MDHQYI/u3eOlpcy7KTVuaKekZeas763vqEveVpfyuPZ8r3i2tXF3d09Gm1sdPnFABnFABnFABnFABnFABnFABnFABnFABnFABaf8fEn/AFzj/wDQpaANSgCvdQG4jKA7TlSD7qwYfhkDNAGf9ku/78X/AHw3/wAcoAPsl3/fi/74b/45QAfZLv8Avxf98N/8coAPsl3/AH4v++G/+OUAH2S7/vxf98N/8coAPsl3/fi/74b/AOOUAH2S7/vxf98N/wDHKAD7Jd/34v8Avhv/AI5QAfZLv+/F/wB8N/8AHKAD7Jd/34v++G/+OUAH2S7/AL8X/fDf/HKAD7Jd/wB+L/vhv/jlAB9ku/78X/fDf/HKAD7Jd/34v++G/wDjlAB9ku/78X/fDf8AxygC1Z2zws0kpDMwUfKMABckcEk5yx70AXqACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKAP/2Q==" --form "language=eng" --form "isOverlayRequired=false" https://api.ocr.space/parse/image
pause
Rem (2) Another example of submitting the file via Base 64, this time in PNG format
Rem Text on image is "Kantu Automation" (it is the logo from https://kantu.io)
curl -H "apikey:helloworld" --form "base64Image=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAvCAYAAAB0ZU25AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJ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/HWTybAU7A3i+VUq1n0YO1OApvxe4tTXPWmk9gxoM4x9yO7PGhXTmKGfOjZI/CmTeWRMNJ7KMn4SiY2PGdct0xhLCweUtxFN6KhEbiYjnCSCHJNhwls1CyRiEhMBPtaI0nsfvmYfflYiZb0BpOY/fNwJZfiDDDqLUfY8ubhN03HinZTPxKBQA233iEFsPSkjhLFqPIEdTGE5haDNntRXZlYUaacYxZhC3bDZik2i9g+GsRQqBkj8Y5bm6neAbq5SMIyY1zzBxkB+j+C+iBWhxFU7HlllxbwBEGxkg2ZoiMCDhERgQcIv8LSxSRzOIhCdsAAAAASUVORK5CYII=" --form "language=eng" --form "isOverlayRequired=false" https://api.ocr.space/parse/image
pause