OhSpotted Python SDK
The official Python SDK for the OhSpotted LinkedIn change tracking API.
Follow public LinkedIn profiles, company pages and jobs, and read what changed on them as signals, checked once a day.
The SDK exposes 9 typed methods, one per documented endpoint, with blocking and asyncio clients built on HTTPX, plus a generic request().
Requirements
- Python 3.11 or newer
Installation
pip install ohspotted
Get your API key
Sign up for OhSpotted or sign in, then copy your API key from the dashboard. The client reads the OHSPOTTED_API_KEY environment variable when no key is passed.
Quick start
import os
from ohspotted import OhSpottedClient
with OhSpottedClient(os.environ["OHSPOTTED_API_KEY"]) as client:
response = client.add_target(url="https://www.linkedin.com/company/linkedin")
print(response.data)
Keyword arguments mirror the API reference. Python keywords get a trailing underscore (from_=), and the wire name is used on the request.
Async I/O
import asyncio
from ohspotted import AsyncOhSpottedClient
async def main() -> None:
async with AsyncOhSpottedClient() as client:
response = await client.add_target(url="https://www.linkedin.com/company/linkedin")
print(response.data)
asyncio.run(main())
HTTP methods
Each method uses the HTTP verb of its endpoint. GET and DELETE send parameters in the query string; POST and PATCH send them as a JSON body. Null values are never sent.
None values are omitted, False and 0 are sent, and sequences repeat the parameter name.
Any endpoint
response = client.request("GET", "/account")
Errors
from ohspotted import OhSpottedAPIError
try:
client.add_target(url="https://www.linkedin.com/company/linkedin")
except OhSpottedAPIError as error:
print(error.status, error.error_code, error, error.response_body)
| Error | When |
|---|---|
OhSpottedConfigurationError |
Missing API key, invalid options, unsupported method, closed client. |
OhSpottedSerializationError |
A required parameter is missing or a value can't be sent. |
OhSpottedTransportError |
Network failure or timeout. |
OhSpottedAPIError |
Non-2xx status (status, error_message, error_code, response_body, raw_response). error_code is the API's error.code, such as no_credits or target_limit (None when the body has none). |
OhSpottedResponseDecodingError |
A success response could not be decoded. |
All of them extend OhSpottedError.
Retries
Requests are retried up to 3 times after a network error, a 408, 500, 502, 503 or 504. Other statuses, such as 400, 401, 402, 404 or 429, and client-side timeouts are not retried: the API's rate limits last until the hour (or the day) is over, and on the free plan every retry would count as a request. The delay starts at 1 second and grows 1.5× per retry (capped at 30 seconds); a Retry-After header wins.
client = OhSpottedClient(max_retries=5, retry_delay=0.5)
# or for one request
client.add_target(url="https://www.linkedin.com/company/linkedin", request_options=RequestOptions(max_retries=0))
Batch requests
batch() runs a function per item on 10 threads (concurrency) and returns one BatchResult per item, in input order. A failing item never stops the others. AsyncOhSpottedClient.batch() does the same with asyncio.
inputs = ["https://www.linkedin.com/company/linkedin", "https://www.linkedin.com/company/microsoft", "https://www.linkedin.com/company/github"]
results = client.batch(inputs, lambda url: client.add_target(url=url), concurrency=5)
for result in results:
if result.ok:
print(result.value.data)
else:
print(inputs[result.index], result.error)
| Constant | Default | Description |
|---|---|---|
DEFAULT_CONCURRENCY |
10 |
Tasks run at the same time by batch |
DEFAULT_TIMEOUT |
120.0 |
Request timeout (seconds) |
MAX_RETRIES |
3 |
Retry attempts after a network error, a 408/5xx |
RETRY_BACKOFF_FACTOR |
1.5 |
Exponential backoff multiplier |
DEFAULT_RETRY_DELAY |
1.0 |
Delay before the first retry (seconds) |
Timeouts and custom HTTPX clients
import httpx
from ohspotted import OhSpottedClient, RequestOptions
client = OhSpottedClient(timeout=60) # seconds, default 120, None disables
client.add_target(url="https://www.linkedin.com/company/linkedin", request_options=RequestOptions(timeout=30))
# Bring your own HTTPX client (proxies, limits, event hooks…). You keep ownership of it.
http_client = httpx.Client(proxy="http://localhost:8080")
client = OhSpottedClient(http_client=http_client)
Endpoints
9 methods, generated from the OpenAPI document.
| Method | HTTP | Description |
|---|---|---|
add_target() |
POST /targets |
Adds a LinkedIn profile, company page or job to the list. The first read happens shortly after, usually within minutes, and only takes the… |
get_target() |
GET /targets/{id} |
One target, with its latest signal. |
get_usage() |
GET /usage |
The plan, the credits left, how many pages are followed and how many the plan allows, and the credits the active pages use in 30 days. Ever… |
list_signals() |
GET /signals |
The signals found on every page of the list since each was added, newest first: the same as The Tea in the app. |
list_target_signals() |
GET /targets/{id}/signals |
The signals found on one page since the account added it, newest first. A signal is a change between two daily reads: nothing is found betw… |
list_targets() |
GET /targets |
The account's list, newest first, with each page's state and its latest signal. A target is a LinkedIn profile, company page or job followe… |
mark_signals_seen() |
POST /signals/seen |
Marks every signal found so far as seen, on every page of the list. No body is needed. For one page, send seen: true to PATCH /targets/{id}. |
remove_target() |
DELETE /targets/{id} |
Takes the page off the list. Its signals are no longer shown to the account; nothing else changes for the people who follow it too. |
update_target() |
PATCH /targets/{id} |
Send paused, muted and/or seen. A paused page isn't read and costs nothing; a muted page is still read and its signals are kept, but it isn… |
All OhSpotted SDKs
| SDK | Package | Install |
|---|---|---|
| Node.js | @ohspotted/sdk |
npm install @ohspotted/sdk |
| Python | ohspotted |
pip install ohspotted |
| Go | ohspotted-go |
go get github.com/ohspotted/ohspotted-go |
| .NET | OhSpotted |
dotnet add package OhSpotted |
| Ruby | ohspotted |
gem install ohspotted |
| PHP | ohspotted/sdk |
composer require ohspotted/sdk |
| Java | ohspotted-java |
build from source, see its README |
| CLI | @ohspotted/cli |
npm install -g @ohspotted/cli |
| MCP server | @ohspotted/mcp |
npx -y @ohspotted/mcp |
Trademarks
LinkedIn® is a registered trademark of LinkedIn Corporation. OhSpotted is not affiliated with, endorsed or sponsored by LinkedIn.
License
MIT — see LICENSE.
Metadata
Release files for ohspotted 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ohspotted-0.1.0.tar.gz | 17.4 kB | Without provenance | Details for ohspotted-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ohspotted-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ohspotted-0.1.0-py3-none-any.whl |
Total release size: 34.9 kB
Release files / ohspotted-0.1.0.tar.gz
| Download URL | ohspotted-0.1.0.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eadcf968bad5480eaf832da120e5b8476419487c460d966bfc9082b3a04b61e5
|
|
BLAKE2b-256 checksum How to use checksums |
b146003a68230dd6538628f7664eee873837f89c1e69409188e8df5dfc0b651b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / ohspotted-0.1.0-py3-none-any.whl
| Download URL | ohspotted-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b22de59a94126f7d2470801059da5ff740f344e1f9be2e67c1115226844f385c
|
|
BLAKE2b-256 checksum How to use checksums |
03e46235d12385210e48827ece73edc4924286bc0901db3c0fbfffadbed42328
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for ohspotted 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.