# 🚀 Linkup Python SDK
[![PyPI version](https://badge.fury.io/py/linkup-sdk.svg)](https://pypi.org/project/linkup-sdk/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
A Python SDK for the [Linkup API](https://linkup-api.readme.io/reference/getting-started), 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`:
```bash
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.
```bash
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](https://github.com/theskumar/python-dotenv) with a
`.env` file (python-dotenv needs to be installed separately in this case), before creating the
Linkup Client.
```python
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.
```python
from linkup import LinkupClient
client = LinkupClient(api_key="YOUR_LINKUP_API_KEY")
...
```
## 📋 Example
```python
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/LinkupPlatform/linkup-python-sdk",
"name": "linkup-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "linkup api sdk client search",
"author": "LINKUP TECHNOLOGIES",
"author_email": "contact@linkup.so",
"download_url": "https://files.pythonhosted.org/packages/85/ac/adee2986ed66be08c36ac8d5b3f880b8821f7aa2deb2b58f0e1a5c287e11/linkup_sdk-0.1.5.tar.gz",
"platform": null,
"description": "# \ud83d\ude80 Linkup Python SDK\n\n[![PyPI version](https://badge.fury.io/py/linkup-sdk.svg)](https://pypi.org/project/linkup-sdk/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nA Python SDK for the [Linkup API](https://linkup-api.readme.io/reference/getting-started), allowing easy integration with Linkup's services. \ud83d\udc0d\n\n## \ud83c\udf1f Features\n\n- \u2705 **Simple and intuitive API client.**\n- \ud83d\udd0d **Supports both standard and deep search queries.**\n- \ud83d\udd12 **Handles authentication and request management.**\n\n## \ud83d\udce6 Installation\n\nInstall the SDK using `pip`:\n\n```bash\npip install linkup-sdk\n```\n\n## \ud83d\udee0\ufe0f Usage\n\n### Setting Up Your Environment\n\n1. **\ud83d\udd11 Obtain an API Key:**\n\n\tSign up on Linkup to get your API key.\n\n2. **\u2699\ufe0f Set the API Key as an Environment Variable:**\n\n Option 1: Export the LINKUP_API_KEY environment variable in your shell before using the Python\n SDK.\n\n ```bash\n export LINKUP_API_KEY='YOUR_LINKUP_API_KEY'\n ```\n\n Option 2: Set the `LINKUP_API_KEY` environment variable directly within Python, using for\n instance `os.environ` or [python-dotenv](https://github.com/theskumar/python-dotenv) with a\n `.env` file (python-dotenv needs to be installed separately in this case), before creating the\n Linkup Client.\n\n ```python\n import os\n from linkup import LinkupClient\n\n os.environ[\"LINKUP_API_KEY\"] = \"YOUR_LINKUP_API_KEY\"\n # or dotenv.load_dotenv()\n client = LinkupClient()\n ...\n ```\n\n Option 3: Pass the Linkup API key to the Linkup Client when creating it.\n\n ```python\n from linkup import LinkupClient\n\n client = LinkupClient(api_key=\"YOUR_LINKUP_API_KEY\")\n ...\n ```\n\n## \ud83d\udccb Example\n\n```python\nfrom linkup import LinkupClient\n\n# Initialize the client (API key can be read from the environment variable or passed as an argument)\nclient = LinkupClient()\n\n# Perform a search query\nsearch_response = client.search(\n query=\"What are the 3 major events in the life of Abraham Lincoln?\",\n depth=\"standard\", # or \"deep\"\n output_type=\"searchResults\", # or \"sourcedAnswer\" or \"structured\"\n structured_output_schema=None, # must be filled if output_type is \"structured\"\n)\nprint(search_response)\n\n# Get access to our Premium Sources Partners content\ncontent_response = client.content(\n url=\"https://www.thebridgechronicle.com/news/capgemini-employees-walk-together-in-celebration-\"\n \"of-indias-independence\",\n)\nprint(content_response)\n```\n\nSee the `examples/` directory for more examples and documentation.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python Client SDK for the Linkup API",
"version": "0.1.5",
"project_urls": {
"Documentation": "https://github.com/LinkupPlatform/linkup-python-sdk#readme",
"Homepage": "https://github.com/LinkupPlatform/linkup-python-sdk",
"Issue Tracker": "https://github.com/LinkupPlatform/linkup-python-sdk/issues",
"Source Code": "https://github.com/LinkupPlatform/linkup-python-sdk"
},
"split_keywords": [
"linkup",
"api",
"sdk",
"client",
"search"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bc02bd91ae82fb04a62acca90f37e15f7e3ca1387b575e9b217270a076c99d25",
"md5": "ed04e93450cdd23443d5b213da87ca74",
"sha256": "482daa64db13a80515b9d4fee346fa25a8893664e8f66312303a10fdea69ac85"
},
"downloads": -1,
"filename": "linkup_sdk-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ed04e93450cdd23443d5b213da87ca74",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 6774,
"upload_time": "2024-11-15T18:48:44",
"upload_time_iso_8601": "2024-11-15T18:48:44.025700Z",
"url": "https://files.pythonhosted.org/packages/bc/02/bd91ae82fb04a62acca90f37e15f7e3ca1387b575e9b217270a076c99d25/linkup_sdk-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "85acadee2986ed66be08c36ac8d5b3f880b8821f7aa2deb2b58f0e1a5c287e11",
"md5": "2b0a6ba0e28e68a10cd25c985de99db3",
"sha256": "b6d80a3b161bd7c274f976e96fd224efda0f54888265a794207e98da82e94a01"
},
"downloads": -1,
"filename": "linkup_sdk-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "2b0a6ba0e28e68a10cd25c985de99db3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 5940,
"upload_time": "2024-11-15T18:48:46",
"upload_time_iso_8601": "2024-11-15T18:48:46.052440Z",
"url": "https://files.pythonhosted.org/packages/85/ac/adee2986ed66be08c36ac8d5b3f880b8821f7aa2deb2b58f0e1a5c287e11/linkup_sdk-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-15 18:48:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "LinkupPlatform",
"github_project": "linkup-python-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "httpx",
"specs": []
},
{
"name": "pydantic",
"specs": []
}
],
"lcname": "linkup-sdk"
}