BloodwebMicroservices Sign in

Getting started

Every microservice works the same way: send a request with your API key, get the result straight back.

Three steps

  1. Create a Bloodweb account and verify your email. New accounts start with 25,000 free tokens.
  2. Make an API key in the dashboard. It is shown once, so copy it somewhere safe.
  3. Call a service. This turns an iPhone photo into a JPG:
curl -H "Authorization: Bearer YOUR_KEY" \
  -F file=@photo.heic -F to=jpg \
  https://bloodweb.net/api/v1/image-convert -o photo.jpg

Each service page lists its options with an example of its own.

Your API key

Send the key in the Authorization header of every call, as Bearer followed by the key. An X-API-Key header works too.

Keys are only read from headers, never from the address, because addresses end up in logs and browser history. Keep keys on your server: anyone who can see a key can spend your tokens. If one leaks, revoke it in the dashboard and make another; you can have up to 10, one per app.

Sending files and options

What comes back

The result itself: the image, the PDF, the zip, or JSON for the data services. There is no wrapper to unpack. Three headers tell you about the call:

X-TokensWhat this call cost.
X-BalanceYour balance after it.
X-Took-MsHow long we spent on it, in milliseconds.

Files you send exist only while your call runs and are deleted when it ends. We keep a record that the call happened (which service, when, how big, whether it worked), never the file or its contents.

Tokens

Every successful call costs tokens: a fixed number for most services, or a number per page, file, image or minute where size drives the work. The pricing page lists them all.

Errors

A failed call answers with a matching HTTP status and a small JSON body. The code is stable and safe to test for; the message is written for people and may be reworded.

{"error": {"code": "bad_param", "message": "\"quality\" must be between 1 and 100."}}
StatusCodesMeaning
400missing_param bad_param missing_file too_many_files bad_json upload_failedSomething is missing or a value is wrong. The message names the parameter.
400bad_data data_too_long bad_color unknown_unit ambiguous_unit incompatible_units unknown_currencyThe value itself cannot be used by that service, such as a barcode with a wrong check digit.
401missing_key invalid_key revoked_keyNo key was sent, or it is not a working key.
402insufficient_tokensThe balance does not cover this call. Top up in the dashboard.
403account_disabledThe account the key belongs to is not active.
404unknown_serviceThere is no service at that address.
405method_not_allowedThat service does not accept GET (or POST). The Allow header says what it does accept.
413file_too_large body_too_large too_longThe upload is bigger, or the audio longer, than the service accepts.
415unsupported_typeThe file is not a type the service reads. Types are detected from the file itself, not its name.
422processing_failed bad_pdf pdf_encrypted bad_audio output_too_large too_many_rowsThe file could not be processed, for example it is damaged or password protected.
429rate_limited too_many_at_once too_many_attemptsToo many calls. Wait the number of seconds in the Retry-After header.
500internalOur fault. Try again, and tell us if it keeps happening.
503busy rates_unavailableA heavy service is at capacity, or exchange rates are unavailable. Try again shortly.
504timeoutThe job took too long and was stopped. Send a smaller input.

Rate limits

Over either limit the call answers 429 and costs nothing. Wait the number of seconds in the Retry-After header, then send it again. Every response also carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the minute ends). Need more? Write to us.

For tools

The whole API is described in OpenAPI 3.0 at /api/v1/openapi.json, which Postman and most code generators can import. A plain list of services is at /api/v1/.

Help

Questions, a problem, or a service you wish existed: support@bloodweb.net. The rules of use are in the microservices terms.