{"id":13747329,"url":"https://github.com/suyesh/ocr_space","last_synced_at":"2026-04-02T02:53:54.963Z","repository":{"id":56886124,"uuid":"75321030","full_name":"suyesh/ocr_space","owner":"suyesh","description":"Free Online OCR for Ruby - Convert images to text","archived":false,"fork":false,"pushed_at":"2019-02-06T21:45:51.000Z","size":54,"stargazers_count":70,"open_issues_count":2,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T02:48:37.486Z","etag":null,"topics":["converting-images","ocr","ocr-ruby","ocr-service","ocr-space","ruby","rubygem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suyesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-01T18:33:29.000Z","updated_at":"2024-09-12T20:06:35.000Z","dependencies_parsed_at":"2022-08-21T00:20:50.154Z","dependency_job_id":null,"html_url":"https://github.com/suyesh/ocr_space","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyesh%2Focr_space","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyesh%2Focr_space/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyesh%2Focr_space/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyesh%2Focr_space/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suyesh","download_url":"https://codeload.github.com/suyesh/ocr_space/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252975174,"owners_count":21834395,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["converting-images","ocr","ocr-ruby","ocr-service","ocr-space","ruby","rubygem"],"created_at":"2024-08-03T06:01:25.257Z","updated_at":"2026-04-02T02:53:54.940Z","avatar_url":"https://github.com/suyesh.png","language":"Ruby","readme":"![OCR.SPACE](https://ocr.space/Content/Images/ocr.space.logo.png)\n[![Gem Version](https://badge.fury.io/rb/ocr_space@2x.png)](https://badge.fury.io/rb/ocr_space)\n\n# OcrSpace\n\nSimple API wrapper for [OCR.Space](https://ocr.space), An awesome free API for converting images to text. Register [here](http://space.us11.list-manage1.com/subscribe?u=ce17e59f5b68a2fd3542801fd\u0026id=252aee70a1) for free api key.\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'ocr_space'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install ocr_space\n\nHosted at [rubygems.org](https://rubygems.org/gems/ocr_space)\n\n### ENV Variables (Optional)\nSetting env variables with API key is optional but for command line interface to work you will have to set ENV variable 'ocr_api_key' to your API key. For more details on the command line interface, scroll to the bottom of this page.\n\n```\n$ export ocr_api_key='YOUR API KEY'\n```\n\n## Usage\n\n![Nicola Tesla](https://bit.ly/2ih9aXt)\n\n## Instantiate OcrSpace resource with API key\n\n```ruby\nrequire 'ocr_space'\n\nresource = OcrSpace::Resource.new(apikey: \"YOUR API KEY\")\n#By default it picks up ocr_api_key='YOUR API KEY' from your env variables\n```\n\n## To convert images from URL\n\n```ruby\nresult = resource.convert url: \"http://bit.ly/2ih9aXt\"\n\nputs result\n=\u003e  #[{\"TextOverlay\"=\u003e{\"Lines\"=\u003e[], \"HasOverlay\"=\u003efalse, \"Message\"=\u003e\"Text overlay is not provided as it is not requested\"}, \"FileParseExitCode\"=\u003e1, \"ParsedText\"=\u003e\"If you want to find the secrets of the \\r\\nuniverse, think in terms of energy, \\r\\nfrequency and vibration. \\r\\nAZ QUOTES \\r\\n\", \"ErrorMessage\"=\u003e\"\", \"ErrorDetails\"=\u003e\"\"}]\n\nresult = resource.clean_convert url: \"http://bit.ly/2ih9aXt\"\n\nputs result\n\n=\u003e #If you want to find the secrets of the universe, think in terms of energy, frequency and vibration. AZ QUOTES\n```\n\n## To convert images from file upload\n\n```ruby\nresult = resource.convert file: \"/Users/suyesh/Desktop/nicola_tesla.jpg\"\n\nputs result #Raw result\n\n=\u003e  #{\"TextOverlay\"=\u003e{\"Lines\"=\u003e[], \"HasOverlay\"=\u003efalse, \"Message\"=\u003e\"Text overlay is not provided as it is not requested\"}, \"FileParseExitCode\"=\u003e1, \"ParsedText\"=\u003e\"If you want to find the secrets of the \\r\\nuniverse, think in terms of energy, \\r\\nfrequency and vibration. \\r\\nAZ QUOTES \\r\\n\", \"ErrorMessage\"=\u003e\"\", \"ErrorDetails\"=\u003e\"\"}\n\nresult = resource.clean_convert file: \"/Users/suyesh/Desktop/nicola_tesla.jpg\"\n\nputs result\n\n=\u003e #If you want to find the secrets of the universe, think in terms of energy, frequency and vibration. AZ QUOTES\n```\n\n## Command line interface ***BONUS***\n\nYou can run ocr_space through shell to get quick result from a image using file path or URL.\n\n```\n$ ocr_space /Users/suyesh/Desktop/nicola_tesla.jpg\n\n=\u003e If you want to find the secrets of the universe, think in terms of energy, frequency and vibration. AZ QUOTES\n```\n\n## Optional\n\nYou can also pass in Optional attributes\n\n```ruby\nisOverlayRequired:\n#[Optional] Default = False Allows you to specify if the image/pdf text overlay is required. Overlay could be #used to show the text over the image\n\nlanguage:\n#Czech = ce; Danish = dan; Dutch = dut; English = eng; Finnish = fin; French = fre; German = ger;Hungarian=hun;\n#Italian = ita; Norwegian = nor; Polish = pol; Portuguese = por; Spanish = spa; Swedish = swe; #ChineseSimplified = chs; Greek = gre; Japanese = jpn; Russian = rus; Turkish = tur; ChineseTraditional = cht; #Korean = kor\n```\n","funding_links":[],"categories":["Ruby","Software"],"sub_categories":["OCR libraries by programming language"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuyesh%2Focr_space","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuyesh%2Focr_space","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuyesh%2Focr_space/lists"}