Skip to main content

A Python Client SDK for the Linkup API

Project description

🚀 Linkup Python SDK

PyPI version License: MIT PyPI - Downloads

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

  1. 🔑 Obtain an API Key:

    Sign up on Linkup to get your API key.

  2. ⚙️ Set-up the API Key:

    Option 1: Export the LINKUP_API_KEY environment variable in your shell before using the Python SDK.

    export LINKUP_API_KEY='YOUR_LINKUP_API_KEY'
    

    Option 2: Set the LINKUP_API_KEY environment variable directly within Python, using for instance os.environ or python-dotenv with a .env file (python-dotenv needs 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linkup_sdk-0.2.6.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linkup_sdk-0.2.6-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file linkup_sdk-0.2.6.tar.gz.

File metadata

  • Download URL: linkup_sdk-0.2.6.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for linkup_sdk-0.2.6.tar.gz
Algorithm Hash digest
SHA256 7b438f4208c04c2cc79843e5b6435b55b0ad718bae1084e1ef569b3b4657e495
MD5 683befdb7e53ff6a9d797ca8a0f647ae
BLAKE2b-256 23d0524a2c07863579299e09bda303f5e1d4a11b176b8153cd7af05d163ce5af

See more details on using hashes here.

Provenance

The following attestation bundles were made for linkup_sdk-0.2.6.tar.gz:

Publisher: publish-to-pypi.yml on LinkupPlatform/linkup-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file linkup_sdk-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: linkup_sdk-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for linkup_sdk-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 63b1039bf3f2a705c59e7ca055be0bfc4bce6a98a641b1d5d606c741c07a6433
MD5 cbfe1a401be604cd29a72e6bc44654cf
BLAKE2b-256 64df25b5723a2659f2454526f550666ea29e9e66120d01048917519aec8e7a7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for linkup_sdk-0.2.6-py3-none-any.whl:

Publisher: publish-to-pypi.yml on LinkupPlatform/linkup-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page