Skip to content

Commit b661d1a

Browse files
committed
docs: update documentation
1 parent dbcb31a commit b661d1a

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

README.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@
33
[![PyPI version](https://badge.fury.io/py/linkup-sdk.svg)](https://pypi.org/project/linkup-sdk/)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
55

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. 🐍
78

89
## 🌟 Features
910

1011
-**Simple and intuitive API client.**
1112
- 🔍 **Supports both standard and deep search queries.**
13+
-**Supports synchronous and asynchronous requests.**
1214
- 🔒 **Handles authentication and request management.**
1315

1416
## 📦 Installation
1517

16-
Install the SDK using `pip`:
18+
Simply install the Linkup Python SDK using `pip`:
1719

1820
```bash
1921
pip install linkup-sdk
@@ -25,11 +27,11 @@ pip install linkup-sdk
2527

2628
1. **🔑 Obtain an API Key:**
2729

28-
Sign up on Linkup to get your API key.
30+
Sign up on Linkup to get your API key.
2931

30-
2. **⚙️ Set the API Key as an Environment Variable:**
32+
2. **⚙️ Set-up the API Key:**
3133

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
3335
SDK.
3436

3537
```bash
@@ -38,7 +40,7 @@ pip install linkup-sdk
3840

3941
Option 2: Set the `LINKUP_API_KEY` environment variable directly within Python, using for
4042
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
4244
Linkup Client.
4345

4446
```python
@@ -62,6 +64,16 @@ pip install linkup-sdk
6264

6365
## 📋 Example
6466

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+
6577
```python
6678
from linkup import LinkupClient
6779

@@ -71,11 +83,20 @@ client = LinkupClient()
7183
# Perform a search query
7284
search_response = client.search(
7385
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"
7688
structured_output_schema=None, # must be filled if output_type is "structured"
7789
)
7890
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()
79100

80101
# Get access to our Premium Sources Partners content
81102
content_response = client.content(
@@ -85,5 +106,7 @@ content_response = client.content(
85106
print(content_response)
86107
```
87108

109+
### 📚 More Examples
110+
88111
See the `examples/` directory for more examples and documentation, for instance on how to use Linkup
89112
entrypoints using asynchronous functions.

examples/1_default_search.py renamed to examples/1_direct_search_results.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
2-
By default, the Linkup search outputs a raw search results, which can then be re-used in different
3-
use-cases, for instance in a RAG system. This is controlled by the output_type parameter, which
4-
defaults to "searchResults".
2+
The Linkup search can output raw search results which can then be re-used in different use-cases,
3+
for instance in a RAG system, with the output_type parameter set to "searchResults".
54
"""
65

76
from linkup import LinkupClient

0 commit comments

Comments
 (0)