Skip to main content

A Python Client SDK for the Linkup API

Project description

🚀 Linkup Python SDK

PyPI version License: MIT

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.
  • 🔒 Handles authentication and request management.

📦 Installation

Install the 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 the API Key as an Environment Variable:

    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")
    ...
    

📋 Example

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="standard",  # or "deep"
    output_type="searchResults",  # or "sourcedAnswer" or "structured"
    structured_output_schema=None,  # must be filled if output_type is "structured"
)
print(search_response)

# Get access to our Premium Sources Partners content
content_response = client.content(
    url="https://www.thebridgechronicle.com/news/capgemini-employees-walk-together-in-celebration-"
    "of-indias-independence",
)
print(content_response)

See the examples/ directory for more examples and documentation.

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.1.5.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

linkup_sdk-0.1.5-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: linkup_sdk-0.1.5.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for linkup_sdk-0.1.5.tar.gz
Algorithm Hash digest
SHA256 b6d80a3b161bd7c274f976e96fd224efda0f54888265a794207e98da82e94a01
MD5 2b0a6ba0e28e68a10cd25c985de99db3
BLAKE2b-256 85acadee2986ed66be08c36ac8d5b3f880b8821f7aa2deb2b58f0e1a5c287e11

See more details on using hashes here.

Provenance

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

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

Attestations:

File details

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

File metadata

  • Download URL: linkup_sdk-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for linkup_sdk-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 482daa64db13a80515b9d4fee346fa25a8893664e8f66312303a10fdea69ac85
MD5 ed04e93450cdd23443d5b213da87ca74
BLAKE2b-256 bc02bd91ae82fb04a62acca90f37e15f7e3ca1387b575e9b217270a076c99d25

See more details on using hashes here.

Provenance

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

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

Attestations:

Supported by

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