1. Get your key
Open the key page
Go to pexafy.com/dashboard/api-keys/create.
No account yet? Sign in with Google or GitHub, or create a free account with your email. No
credit card.
Create the key
Leave the key type on Pexafy API and click Create API Key. The name and the
expiration are optional.
Copy your key
The next page shows your key: click Copy key. Below it, Pexafy AI Assist asks what you
are building and gives you code that runs as is, with your key already in it. Lost the key?
It stays in API Keys: click Display next to it.
The key works on your first call.The free plan includes 5,000 requests a month, up to 1,200 an hour — see Plans & limits.
2. Make your first request
Pick your language, copy the code, and replaceYOUR_API_KEY with your key. Tip: on the page that
shows your key, Pexafy AI Assist writes this code for you, with your key already in it.
| Language | Save the code as | Install once | Run, in the same folder |
|---|---|---|---|
| Python 3 | search.py | pip install requests | python search.py |
| JavaScript (Node.js 18 or later) | search.mjs | nothing | node search.mjs |
| cURL | nothing to save | nothing | paste the line and press Enter |
| PHP 7.4 or later | search.php | nothing | php search.php |
- On macOS and Linux, type
python3andpip3instead ofpythonandpip. - On Windows, type
curl.exeinstead ofcurl. - Keep the
.mjsending for JavaScript, and run it with Node.js, on your computer or your server. Never in a web page, where anyone could read your key. - PHP uses its curl extension. If PHP says
curl_initis undefined, install it (on Ubuntu:sudo apt install php-curl).
3. Read the response
The answer is JSON. Here is a trimmed example: each photo has more fields than shown.datais the list of photos, best match first.urlsgives each photo in several sizes:thumbis small,regularsuits a web page,fullis the largest.attribution.plainis a ready-made credit line.attribution.htmlis the same, with links.pagination.next_cursorgets you the next page: see Pagination.errorisnullwhen all went well. Otherwise it says what went wrong: see Errors.
Using an AI assistant instead?
Use Pexafy in your AI assistant
ChatGPT, Claude, Cursor, VS Code and more. Most of them need no key: you sign in once.
Libraries and integrations
Libraries & integrations
A Python library, LangChain, the Vercel AI SDK, agent frameworks and no-code tools such as n8n,
Make and Zapier. The same key works everywhere.
Get help as you build
Answers are generated, so verify anything going to production. When it does not know, it
says so rather than guessing — and that tells us a page is missing.
Next steps
- Page through results by page number or with a cursor
- Browse Search, Photos, Facets, Collections and Usage for every endpoint
- Dashboard for your usage, Plans & limits and pricing for the plans