EnvoAPI for Python
Call EnvoAPI from your Python app to look up profiles, companies, posts, jobs, and more. Includes typed sync and async clients.
Requires Python 3.11+.
Install
python -m pip install envoapi
Set your API key
# macOS / Linux
export ENVOAPI_API_KEY="your-api-key"
# Windows PowerShell
$env:ENVOAPI_API_KEY="your-api-key"
Run your app from the same terminal. Both clients read this variable automatically. Keep your key out of source control.
Make a request
Save as app.py:
from envoapi import EnvoAPI
with EnvoAPI() as client:
response = client.profiles.get_posts(username="satyanadella")
print(response.body.data.posts)
print(response.body.meta.credit_cost)
Run it:
python app.py
Replace satyanadella with the profile username you want to look up. The with block closes the client when you are done.
Async requests
import asyncio
from envoapi import AsyncEnvoAPI
async def main():
async with AsyncEnvoAPI() as client:
response = await client.profiles.get_posts(username="satyanadella")
print(response.body.data.posts)
asyncio.run(main())
In an app that already has an event loop, use await inside your async function instead of calling asyncio.run().
Client options
You can also pass a key from your app's configuration. An explicit key overrides ENVOAPI_API_KEY.
import os
from envoapi import EnvoAPI
with EnvoAPI(api_key=os.environ["ENVOAPI_API_KEY"], timeout=30.0) as client:
response = client.profiles.get_posts(username="satyanadella")
print(response.body.data.posts)
Both clients accept the same options. The default timeout is 60 seconds per HTTPX timeout phase; timeout accepts seconds or httpx.Timeout. Use base_url to change the default https://api.envoapi.com, or transport for a custom HTTPX transport.
Handle errors
from envoapi import APIError, EnvoAPI
try:
with EnvoAPI() as client:
response = client.profiles.get_posts(username="satyanadella")
print(response.body.data.posts)
except APIError as error:
print(error.status, error.code, str(error), error.request_id)
APIError means the API returned an error. TransportError means the request failed, and DecodeError means the response could not be read in the expected format. All three can be imported from envoapi.
Responses and more methods
response.body.data: the result.response.body.meta: request metadata, includingcredit_cost.response.statusandresponse.headers: HTTP status and headers.response.body.to_dict(): the response body as a dictionary.
Model attributes use snake_case. The SDK does not retry requests or fetch additional pages automatically. For paginated methods, pass the returned continuation cursor to the next call with the same search parameters. Requests use your EnvoAPI credits.
See the method reference for all available calls. For models and enums, use from envoapi import models.
GitHub · Issues · MIT license
Release files for envoapi 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| envoapi-0.1.1.tar.gz | 144.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| envoapi-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 743.7 kB
Release files / envoapi-0.1.1.tar.gz
| Download URL | envoapi-0.1.1.tar.gz |
|---|---|
| Size | 144.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0fecea3d1e469f6d4913d939b5c41df7176c338183d8a9e64f19ad3f0bde55da
|
|
BLAKE2b-256 checksum How to use checksums |
7599e9de365f545abc24c6cfe2368ac9c149d874cecda61017aa9c0ab0513b41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|
Release files / envoapi-0.1.1-py3-none-any.whl
| Download URL | envoapi-0.1.1-py3-none-any.whl |
|---|---|
| Size | 599.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8fe4592b9377e25a4211d43db47006f214133ce1570d66afcaa85ba427022bf5
|
|
BLAKE2b-256 checksum How to use checksums |
ad548db108c5c619c675183296ffa229ca1434f69b3328a0f23f4610b9d17945
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|