A Python Client SDK for the Linkup API
Project description
🚀 Linkup Python SDK
A Python SDK for the Linkup API, allowing easy integration with Linkup's services. 🐍
🌟 Features
- ✅ Simple and intuitive API client.
- 🔍 Supports both standard and deep search queries.
- ⚡ Supports synchronous and asynchronous requests.
- 🔒 Handles authentication and request management.
📦 Installation
Simply install the Linkup Python SDK using pip:
pip install linkup-sdk
🛠️ Usage
Setting Up Your Environment
-
🔑 Obtain an API Key:
Sign up on Linkup to get your API key.
-
⚙️ Set-up the API Key:
Option 1: Export the
LINKUP_API_KEYenvironment variable in your shell before using the Python SDK.export LINKUP_API_KEY='YOUR_LINKUP_API_KEY'
Option 2: Set the
LINKUP_API_KEYenvironment variable directly within Python, using for instanceos.environor python-dotenv with a.envfile (python-dotenvneeds to be installed separately in this case), before creating the Linkup Client.import os from linkup import LinkupClient os.environ["LINKUP_API_KEY"] = "YOUR_LINKUP_API_KEY" # or dotenv.load_dotenv() client = LinkupClient() ...
Option 3: Pass the Linkup API key to the Linkup Client when creating it.
from linkup import LinkupClient client = LinkupClient(api_key="YOUR_LINKUP_API_KEY") ...
📋 Examples
All search queries can be used with two very different modes:
- with
depth="standard", the search will be straightforward and fast, suited for relatively simple queries (e.g. "What's the weather in Paris today?") - with
depth="deep", the search will use an agentic workflow, which makes it in general slower, but it will be able to solve more complex queries (e.g. "What is the company profile of LangChain accross the last few years, and how does it compare to its concurrents?")
📝 Standard Search Query
from linkup import LinkupClient
# Initialize the client (API key can be read from the environment variable or passed as an argument)
client = LinkupClient()
# Perform a search query
search_response = client.search(
query="What are the 3 major events in the life of Abraham Lincoln?",
depth="deep", # "standard" or "deep"
output_type="sourcedAnswer", # "searchResults" or "sourcedAnswer" or "structured"
structured_output_schema=None, # must be filled if output_type is "structured"
)
print(search_response)
📚 More Examples
See the examples/ directory for more examples and documentation, for instance on how to use Linkup
entrypoints using asynchronous functions.
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 linkup_sdk-0.2.8.tar.gz.
File metadata
- Download URL: linkup_sdk-0.2.8.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ed45b76bb585ebf88d7bafa248e4907d116b19661880978b862c5f8b3b79686
|
|
| MD5 |
666683074cbc0ef3e1055ceca170d62c
|
|
| BLAKE2b-256 |
9e1517f441d73d1dea76398980497bb8a3cce8a2b63dab42779610c04b6800d6
|
Provenance
The following attestation bundles were made for linkup_sdk-0.2.8.tar.gz:
Publisher:
publish-to-pypi.yml on LinkupPlatform/linkup-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
linkup_sdk-0.2.8.tar.gz -
Subject digest:
7ed45b76bb585ebf88d7bafa248e4907d116b19661880978b862c5f8b3b79686 - Sigstore transparency entry: 257341146
- Sigstore integration time:
-
Permalink:
LinkupPlatform/linkup-python-sdk@c1d1f9fb5b384c43db03f783dfc4fe146d314844 -
Branch / Tag:
refs/tags/v0.2.8 - Owner: https://github.com/LinkupPlatform
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@c1d1f9fb5b384c43db03f783dfc4fe146d314844 -
Trigger Event:
push
-
Statement type:
File details
Details for the file linkup_sdk-0.2.8-py3-none-any.whl.
File metadata
- Download URL: linkup_sdk-0.2.8-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96acaf2c773963c21133b31d1ef18f5322ba07a34ef79c375fe75e44b9501cb6
|
|
| MD5 |
8d16956788c3718699ca63a32d328383
|
|
| BLAKE2b-256 |
6ca2be93a8d93959e4e3756afa59c9312979ea641b90b7233acb4464a824f3c5
|
Provenance
The following attestation bundles were made for linkup_sdk-0.2.8-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on LinkupPlatform/linkup-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
linkup_sdk-0.2.8-py3-none-any.whl -
Subject digest:
96acaf2c773963c21133b31d1ef18f5322ba07a34ef79c375fe75e44b9501cb6 - Sigstore transparency entry: 257341151
- Sigstore integration time:
-
Permalink:
LinkupPlatform/linkup-python-sdk@c1d1f9fb5b384c43db03f783dfc4fe146d314844 -
Branch / Tag:
refs/tags/v0.2.8 - Owner: https://github.com/LinkupPlatform
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@c1d1f9fb5b384c43db03f783dfc4fe146d314844 -
Trigger Event:
push
-
Statement type: