OCR

API - Text Detection (OCR)

REQUEST

Analyze an image and return any text found in the scene. Returned is not only the text but a list of bad words from 27 languages.

OCR Supported Languages Include

afr - Afrikaans, amh - Amharic, ara - Arabic, asm - Assamese, aze - Azerbaijani, aze_cyrl - Azerbaijani - Cyrillic, bel - Belarusian, ben - Bengali, bod - Tibetan, bos - Bosnian, bul - Bulgarian, cat - Catalan; Valencian, ceb - Cebuano, ces - Czech, chi_sim - Chinese - Simplified, chi_tra - Chinese - Traditional, chr - Cherokee, cym - Welsh, dan - Danish, deu - German, dzo - Dzongkha, ell - Greek, Modern (1453-), eng - English, enm - English, Middle (1100-1500), epo - Esperanto, est - Estonian, eus - Basque, fas - Persian, fin - Finnish, fra - French, frk - Frankish, frm - French, Middle (ca. 1400-1600), gle - Irish, glg - Galician, grc - Greek, Ancient (-1453), guj - Gujarati, hat - Haitian; Haitian Creole, heb - Hebrew, hin - Hindi, hrv - Croatian, hun - Hungarian, iku - Inuktitut, ind - Indonesian, isl - Icelandic, ita - Italian, ita_old - Italian - Old, jav - Javanese, jpn - Japanese, kan - Kannada, kat - Georgian, kat_old - Georgian - Old, kaz - Kazakh, khm - Central Khmer, kir - Kirghiz; Kyrgyz, kor - Korean, kur - Kurdish, lao - Lao, lat - Latin, lav - Latvian, lit - Lithuanian, mal - Malayalam, mar - Marathi, mkd - Macedonian, mlt - Maltese, msa - Malay, mya - Burmese, nep - Nepali, nld - Dutch; Flemish, nor - Norwegian, ori - Oriya, pan - Panjabi; Punjabi, pol - Polish, por - Portuguese, pus - Pushto; Pashto, ron - Romanian; Moldavian; Moldovan, rus - Russian, san - Sanskrit, sin - Sinhala; Sinhalese, slk - Slovak, slv - Slovenian, spa - Spanish; Castilian, spa_old - Spanish; Castilian - Old, sqi - Albanian, srp - Serbian, srp_latn - Serbian - Latin, swa - Swahili, swe - Swedish, syr - Syriac, tam - Tamil, tel - Telugu, tgk - Tajik, tgl - Tagalog, tha - Thai, tir - Tigrinya, tur - Turkish, uig - Uighur; Uyghur, ukr - Ukrainian, urd - Urdu, uzb - Uzbek, uzb_cyrl - Uzbek - Cyrillic, vie - Vietnamese, yid - Yiddish

Bad Word Languages Include

Arabic, Czech, Danish, German, English, Esperanto, Spanish, Castilian, Persian, Finnish, French, Hindi, Hungarian, Italian, Japanese, Korean, Dutch, Flemish, Norwegian, Polish, Portuguese, Russian, Swedish, Thai, Klingon, Turkish, Chinese.

        https://api.moderatecontent.com/ocr/?
        exclude=ho,hell&
        lang=eng&
        key=your_api_key&
        url=https://www.moderatecontent.com/img/sample_text.png
    
ARGUMENTS

exclude
string
Optional
A comma deliminated list of words to exclude from bad words check. Often words that your community would not be offended by.
ho,hell

lang
string
Optional
A code representing the language (see above for languages with codes) to search for when completing the OCR.

Codes Include

afr, amh, ara, asm, aze, aze_cyrl, bel, ben, bod, bos, bul, cat, ceb, ces, chi_sim, chi_tra, chr, cym, dan, deu, dzo, ell, eng, enm, epo, est, eus, fas, fin, fra, frk, frm, gle, glg, grc, guj, hat, heb, hin, hrv, hun, iku, ind, isl, ita, ita_old, jav, jpn, kan, kat, kat_old, kaz, khm, kir, kor, kur, lao, lat, lav, lit, mal, mar, mkd, mlt, msa, mya, nep, nld, nor, ori, pan, pol, por, pus, ron, rus, san, sin, slk, slv, spa, spa_old, sqi, srp, srp_latn, swa, swe, syr, tam, tel, tgk, tgl, tha, tir, tur, uig, ukr, urd, uzb, uzb_cyrl, vie, yid
eng

key
string
The api key used to reference your account within the system.
f96f44847704d2291b2967536afe8898

url
string
The url pointing at an image accessible over the internet, no larger than 10mb and with a format of either .jpg .png .bmp .gif.
https://www.moderatecontent.com/img/sample_text.png
RESPONSE

        {
            "error_code": 0,
            "error": "",
            "found_text": "I'm a normal text\nI'm a bold text",
            "url_classified": "https://www.moderatecontent.com/img/sample_text.png",
            "exclude": [
                "ho",
                "hell"
            ],
            "bad_words": []
        }
    

url_classified
string
The url pointing at an image accessible over the internet, no larger than 10mb and with a format of either .jpg .png .bmp .gif.
https://www.moderatecontent.com/img/sample.jpg

found_text
string
The text found in the scene, including line breaks to denote a newline.
I'm a normal text\nI'm a bold text

exclude
string
The comma deliminated list of words excluded from bad words check.
ho,hell

bad_words
array
An array of inappropriate words and the number of times they appear within the text captured by the OCR. Our list contains bad words for 27 languages.
{"ho":2,"hell":3}

error_code
integer
A code representing the type of error returned. The value 0 means no error was found.
1024

error
integer
Optional
A message representing the type of error returned. This occurs when the error_code is not 0.
No url specified in querystring