oushodh
GET STARTED

SDKs

The official SDKs wrap the public /v1 API with the same methods, errors and retry rules in every language. Each one reads the key from OUSHODH_API_KEY when you pass none.

INSTALL TODAYEvery SDK installs from its registry: Packagist, npm, PyPI, Go modules, crates.io, Maven Central, NuGet, RubyGems and pub.dev.

Install and first call

InstallTerminal
composer require oushodh/oushodh-php
First callPHP
use Oushodh\Client;

$oushodh = new Client(); // reads OUSHODH_API_KEY
$result = $oushodh->search('paracetamol', limit: 5);
$medicine = $oushodh->getMedicine('MED-012933');

Languages

Nine languages, one repository each.

Methods in every SDK

Each SDK has the same methods. Their names follow each language's style, such as listMedicines in PHP and JavaScript and list_medicines in Python, Rust and Ruby.

  • MetaGET /v1/metaYour account and the number of medicines your plan reads. Call it to check that a key works.
  • List medicinesGET /v1/medicinesOne page, with cursor paging: pass next back as cursor for the next page.
  • List allGET /v1/medicines, every pagePages for you and gives the medicines one by one.
  • SearchGET /v1/medicines/searchThe best matches for a person typing a name.
  • Get a medicineGET /v1/medicines/{ref}One medicine by any ID, an old ID or its UUID.
  • Image URL, get imageGET /v1/images/{file}The picture's address, or its bytes.

Errors and retries

Each SDK raises one exception for each HTTP family. Match on the exception or on its error code, not on the message: the message is for people and may change.

An SDK retries only these:

  • 429 rate_limitedIt waits the seconds in the Retry-After header, then tries again.
  • 5xxA fault on our side.
  • Network errorsNo answer came back.

A 429 quota_exceeded is raised at once, with no retry.