Examples of how to use PSMEDx API
This pages will be published at PSMEDx Examples
We are focussing here in how to use a Public Key that can be obtained from PSMEDx website once you have an account.
With this Public Key you will be able to use the API without the need of a Secret Key that is used for authentication.
Meaning you can access to GET requests that provide images based on query parameters.
In order for this public key to be secure, you need to add the allowed origin to your account. This is done in the Account section of the website.
This example shows how to get an image with the background.
Basic example is this one:
<img src="https://api.psmedx.com//remove-background/?image_url=YOUR_IMAGE_URL&pub_api_key=YOUR_PUBLIC_KEY" />But We provide a more complete example using htmx and Alpine.js