How to build an API Call
Building your API call is easy
The first step – know your target URL:
There are many web targets that are supported using this API.
Find the URL that you’re interested in and add any needed parameters
https://www.example.com?paramter=value¶mter2=value2
Second step – Encode your target URL:
Using URL-encode, please encode your selected target URL.
https%3A%2F%2Fwww.example.com%3Fparamter%3Dvalue%26para
mter2%3Dvalue2
Third step – API call format:
The first part of the API call is as follows:
https://run.operia.io/API_KEY/?url=
The second part is the encoded URL:
https://run.operia.io/API_KEY/?url=https%3A%2F%2Fwww.ex
ample.com%3Fparamter%3Dvalue%26paramter2%3Dvalue2
Statistics API
In order to know the statistics, you can use the following:
To show daily statistics for the last 30 days, use one of the following similar
urls:
https://run.operia.io/__KEY__/statistics
https://run.operia.io/__KEY__/statistics/daily
https://run.operia.io/__KEY__/statistics/daily/30
To specify another amount of days, either change it in the last url, or add
the ?days=XX parameter to any of the urls:
https://run.operia.io/__KEY__/statistics/daily/60
https://run.operia.io/__KEY__/statistics?days=60
To show monthly statistics for the last 12 months, use one of the following
similar urls:
https://run.operia.io/__KEY__/statistics/monthly
https://run.operia.io/__KEY__/statistics/monthly/12
To specify another amount of months, either change it in the last url, or
add the ?months=XX parameter to any of the urls:
https://run.operia.io/__KEY__/statistics/monthly/24
https://run.operia.io/__KEY__/statistics/monthly?months=24
Errors
On failure, the response status code will be in the range of 4xx-5xx and
the error string will be returned as the response body.
Failed sending request to the backend provider
or parsing provider’s response. Feel free to
REQUEST_FAILED resend the request, it may be served by a
different provider next time. You will not be
charged for the failed request.
Provider did not respond in a timely manner.
Feel free to resend the request, it may be
REQUEST_TIMED_OUT
served by a different provider next time. You will
not be charged for the timed-out request.
Your account does not have enough credits to
NO_CREDITS process the request. Please contact us for
options.
The supplied URL is invalid. Make sure it includes
INVALID_URL the scheme ( http:// or https:// ) and that it
is properly encoded.
No credits 402
Request Timeout: 500
Request Failed: 500
Invalid URL: 400
How to protect your API key
Since (most) requests to the API are performed using the HTTP GET method
to a URL which includes your KEY, it’s relatively easy to expose it to
unwanted parties. You should be aware of this when sharing constructed
API links with peers.
Another point to consider is that most messaging platforms today attempt
to generate preview of shared links, which would trigger a valid API call
and charge credits from your account. For this reason it is recommended
to avoid sending constructed API links which includes your KEY via these
platforms.
If you believe your key has been compromised, please contact us right
away and we will send you a new key.
A more secure authentication method also exists. If you’re interested in
using it, please contact us.