3
3
[ ![ PyPI version] ( https://badge.fury.io/py/linkup-sdk.svg )] ( https://pypi.org/project/linkup-sdk/ )
4
4
[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( LICENSE )
5
5
6
- A Python SDK for the [ Linkup API] ( https://linkup-api.readme.io/reference/getting-started ) , allowing easy integration with Linkup's services. 🐍
6
+ A Python SDK for the [ Linkup API] ( https://linkup-api.readme.io/reference/getting-started ) , allowing
7
+ easy integration with Linkup's services. 🐍
7
8
8
9
## 🌟 Features
9
10
10
11
- ✅ ** Simple and intuitive API client.**
11
12
- 🔍 ** Supports both standard and deep search queries.**
13
+ - ⚡ ** Supports synchronous and asynchronous requests.**
12
14
- 🔒 ** Handles authentication and request management.**
13
15
14
16
## 📦 Installation
15
17
16
- Install the SDK using ` pip ` :
18
+ Simply install the Linkup Python SDK using ` pip ` :
17
19
18
20
``` bash
19
21
pip install linkup-sdk
@@ -25,11 +27,11 @@ pip install linkup-sdk
25
27
26
28
1 . ** 🔑 Obtain an API Key:**
27
29
28
- Sign up on Linkup to get your API key.
30
+ Sign up on Linkup to get your API key.
29
31
30
- 2 . ** ⚙️ Set the API Key as an Environment Variable :**
32
+ 2 . ** ⚙️ Set-up the API Key:**
31
33
32
- Option 1: Export the LINKUP_API_KEY environment variable in your shell before using the Python
34
+ Option 1: Export the ` LINKUP_API_KEY ` environment variable in your shell before using the Python
33
35
SDK.
34
36
35
37
``` bash
@@ -38,7 +40,7 @@ pip install linkup-sdk
38
40
39
41
Option 2: Set the ` LINKUP_API_KEY ` environment variable directly within Python, using for
40
42
instance ` os.environ ` or [ python-dotenv] ( https://github.com/theskumar/python-dotenv ) with a
41
- ` .env ` file (python-dotenv needs to be installed separately in this case), before creating the
43
+ ` .env ` file (` python-dotenv ` needs to be installed separately in this case), before creating the
42
44
Linkup Client.
43
45
44
46
``` python
@@ -62,6 +64,16 @@ pip install linkup-sdk
62
64
63
65
## 📋 Example
64
66
67
+ All search queries can be used with two very different modes:
68
+
69
+ - with ` depth="standard" ` , the search will be straightforward and fast, suited for relatively simple
70
+ queries (e.g. "What's the weather in Paris today?")
71
+ - with ` depth="deep" ` , the search will use an agentic workflow, which makes it in general slower,
72
+ but it will be able to solve more complex queries (e.g. "What is the company profile of LangChain
73
+ accross the last few years, and how does it compare to its concurrents?")
74
+
75
+ ### 📝 Standard Search Query
76
+
65
77
``` python
66
78
from linkup import LinkupClient
67
79
@@ -71,11 +83,20 @@ client = LinkupClient()
71
83
# Perform a search query
72
84
search_response = client.search(
73
85
query = " What are the 3 major events in the life of Abraham Lincoln?" ,
74
- depth = " standard " , # or "deep"
75
- output_type = " searchResults " , # or "sourcedAnswer" or "structured"
86
+ depth = " deep " , # "standard" or "deep"
87
+ output_type = " sourcedAnswer " , # "searchResults" or "sourcedAnswer" or "structured"
76
88
structured_output_schema = None , # must be filled if output_type is "structured"
77
89
)
78
90
print (search_response)
91
+ ```
92
+
93
+ ### 📰 Content Access
94
+
95
+ ``` python
96
+ from linkup import LinkupClient
97
+
98
+ # Initialize the client (API key can be read from the environment variable or passed as an argument)
99
+ client = LinkupClient()
79
100
80
101
# Get access to our Premium Sources Partners content
81
102
content_response = client.content(
@@ -85,5 +106,7 @@ content_response = client.content(
85
106
print (content_response)
86
107
```
87
108
109
+ ### 📚 More Examples
110
+
88
111
See the ` examples/ ` directory for more examples and documentation, for instance on how to use Linkup
89
112
entrypoints using asynchronous functions.
0 commit comments