Skip to content

API - Documentation

PhotoILike provides an API REST service that allows companies to integrate the services into their own systems. In this documentation you will find the necessary instructions to make this integration as easy as possible. If you still have any questions or problems, please do not hesitate to contact us through this link.

Client-key

For end-users, PhotoILike provides a Software as a Service at https://app.photoilike.com. However, companies that need to support multiple customers can integrate our services within their own implementations.

PhotoILike provides a straightforward way to work with multiple users through client-keys, with each end-user having a unique client-key. PhotoILike allows to create as many client-keys as needed and these must be used for each of the resources requested.

Maximum number of simultaneous requests

Most of the requests that can be made to the PhotoILike API must be accompanied by a client-key and have a limit per second. The following table shows the maximum number of requests per second that can be made per client-key.

Resource Limit
score 5/s
label 5/s
sort 10/s

The other requests do not have to be accompanied by a client-key, but they also have a limit per second. The following table shows the number of requests that can be made in these cases.

Resource Limit
client key 5/s

Error code

HTTP codes are used to define the errors of a request that is not resolved in a satisfactory way. Below are the different types of errors that can occur when using our API, but if you have any questions you can always contact the PhotoILike team through this link.

Client-side errors

HTTP Code Meaning
400 Bad request.
This error usually appears when a parameter that has been entered is not correct, unexpected parameters have been entered or a parameter has not been entered yet.
401 You have not been authenticated correctly.
402 All available credits have been exhausted.
403 You do not have the appropriate permits to be able to carry out the requested request.
404 The requested resource is not found.
405 The requested method is not available.
408 The url from which you are trying to obtain the resource to be processed takes too long.
411 The server containing the image to be processed does not return information about its size.
413 The requested request has a very large size.
415 The format in which the request was sent is not supported.
429 Many consecutive requests have been made.
The X-RateLimit parameters in the headers indicate the current status of the requests.

Server-side errors

PhotoILike works hard to ensure that no errors occur on our servers, but for reasons beyond our control any of the following may occur:

HTTP Code Meaning
500 An internal server error has occurred and the request could not be processed.
502 Access to services is being configured and is not yet available.
503 The service is not available at this time.
504 The server is taking longer than expected to resolve the request.

Recommendations

Many components of a network, such as DNS servers, switches, load balancers, etc., can generate errors at any point in the life of a given request. The usual technique for dealing with these error responses in a network environment is to implement retries in the client application. This technique increases the reliability of the application and reduces operational costs for the developer.

For this reason, when using any API, whether PhotoILike or any other, it is necessary to retry the original requests that receive server errors (5xx) or limitation. However, client errors (4xx)1 indicate that the request needs to be reviewed to correct the problem before retrying the request.

A simple way to perform the attempts is the use of exponential backoff and jitter algorithms for which implementations are available for several languages2.


  1. For errors 408 and 429 you can retry the request because they may be a temporary failure. In the example of error 408 it is due to the fact that the URL from which you are trying to obtain the image takes a long time to respond, which indicates that it may be saturated at a certain moment and that later in time it is not saturated and responds normally. As for error 429, it is due to the fact that many simultaneous requests are being made, which by definition indicates that in a short period of time requests may be made again. 

  2. Some libraries available with the implementation: