Official synchronous Python SDK for Linked API.
Project description
This official Python SDK is the synchronous way to integrate with Linked API. It provides pre-defined workflow operations, direct account/statistics methods, admin APIs, authentication headers, polling, and structured error responses.
Get started
To get started with Linked API Python SDK, read these essential guides first:
- Core concepts - understand how Linked API works.
- Installation & authorization - install the SDK and authorize it.
- Predefined vs. custom workflows - choose ready-made operations or custom workflow definitions.
- Handling results and errors - process successful data and action errors.
- Persisting and cancelling workflows - save, resume, and cancel workflows.
Install the package:
pip install linkedapi
Initialize the client:
from linkedapi import LinkedApi, LinkedApiConfig
linkedapi = LinkedApi(
LinkedApiConfig(
linked_api_token="your-linked-api-token",
identification_token="your-identification-token",
)
)
Run a predefined workflow and poll the result:
from linkedapi import FetchPersonParams
workflow = linkedapi.fetch_person.execute(
FetchPersonParams(
person_url="https://www.linkedin.com/in/john-doe",
retrieve_experience=True,
retrieve_posts=True,
posts_retrieval_config={"limit": 10},
)
)
result = linkedapi.fetch_person.result(workflow.workflow_id)
if result.data:
print(result.data.name)
for error in result.errors:
print(error.type, error.message)
Execute a custom workflow:
workflow = linkedapi.custom_workflow.execute(
{
"actionType": "st.searchCompanies",
"term": "Tech Inc",
"filter": {
"sizes": ["51-200", "2001-5000"],
"locations": ["San Francisco", "New York"],
"industries": ["Software Development"],
},
"then": {"actionType": "st.openCompanyPage", "basicInfo": True},
}
)
result = linkedapi.custom_workflow.result(workflow.workflow_id)
print(result.data)
Continue polling after a workflow timeout:
from linkedapi import LinkedApiWorkflowTimeoutError
try:
result = linkedapi.fetch_person.result(workflow.workflow_id, timeout=30.0)
except LinkedApiWorkflowTimeoutError as error:
result = linkedapi.fetch_person.result(error.workflow_id)
Cancel a workflow:
cancelled = linkedapi.fetch_person.cancel(workflow.workflow_id)
print(cancelled)
License
This project is licensed under the MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file linkedapi-1.1.1.tar.gz.
File metadata
- Download URL: linkedapi-1.1.1.tar.gz
- Upload date:
- Size: 30.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b49925a481eb5d004fca0efb1670ee67c16177b5af4679936696e9bb5b822654
|
|
| MD5 |
5e8ded806abf2af1464d60d3dd77d9d9
|
|
| BLAKE2b-256 |
e1ebad479d8b6300a3d8d67e81595c09b8aef5a47f1b37e2954dfe86869f7288
|
Provenance
The following attestation bundles were made for linkedapi-1.1.1.tar.gz:
Publisher:
publish.yaml on Linked-API/linkedapi-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
linkedapi-1.1.1.tar.gz -
Subject digest:
b49925a481eb5d004fca0efb1670ee67c16177b5af4679936696e9bb5b822654 - Sigstore transparency entry: 2084513659
- Sigstore integration time:
-
Permalink:
Linked-API/linkedapi-python@e430f5091f9fad31cfef04c3f0cfff0c8babe6be -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Linked-API
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@e430f5091f9fad31cfef04c3f0cfff0c8babe6be -
Trigger Event:
push
-
Statement type:
File details
Details for the file linkedapi-1.1.1-py3-none-any.whl.
File metadata
- Download URL: linkedapi-1.1.1-py3-none-any.whl
- Upload date:
- Size: 51.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf100adba03ca014ef3b245b29e4bce76145ac16760f4f1cc68edf6c9477902d
|
|
| MD5 |
87b98560c6ae12f911b8f1dc37b639b2
|
|
| BLAKE2b-256 |
d4c36a2a8db60b22c22480e0f99c2bcc456753f21169f6bfbdb9d4af60079b8b
|
Provenance
The following attestation bundles were made for linkedapi-1.1.1-py3-none-any.whl:
Publisher:
publish.yaml on Linked-API/linkedapi-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
linkedapi-1.1.1-py3-none-any.whl -
Subject digest:
bf100adba03ca014ef3b245b29e4bce76145ac16760f4f1cc68edf6c9477902d - Sigstore transparency entry: 2084513689
- Sigstore integration time:
-
Permalink:
Linked-API/linkedapi-python@e430f5091f9fad31cfef04c3f0cfff0c8babe6be -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Linked-API
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@e430f5091f9fad31cfef04c3f0cfff0c8babe6be -
Trigger Event:
push
-
Statement type: