Ruby interface to the infermedica REST API
This is a Ruby interface to the Infermedica REST API: https://developer.infermedica.com/docs/api
It is (very) loosely based on the Python library: https://github.com/infermedica/python-api.
gem install infermedica
- json. I have tested with 1.8.x
- Ruby 2.x
You will first need to get an API Id and Key from the Infermedica site https://developer.infermedica.com/docs/api
To start using the API, require the infermedica gem and create an Infermedica::Api object, passing the api_id and api_key to the constructor.
The constructor takes a hash as argument, so you have different options to pass the id and key:
require 'infermedica' api = Infermedica::Api.new(api_id: 'xxxxx', api_key: 'xxxxxxxxxxx')
Or put the key and id in a .yaml file, read it, and pass the resulting hash to the constructor
:api_id: xxxxx :api_key: xxxxxxxxxxxxxx :dev_mode: true
In your script
require 'infermedica' require 'yaml' access = YAML.load(File.read('./config.yaml')) api = Infermedica::Api.new(access)
The examples directory has some examples to get you started. They all assume that you have a config.yaml in the same directory. Just create one with your own api_id and api_key and you should be able to just invoke ruby on each example.
The Infermedica REST API is copyrighted by Infermedica.
The Ruby code itself is released under the MIT license.