Skip to content

Commit af02d85

Browse files
committed
Update readme
1 parent c2c7192 commit af02d85

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

examples/map.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from oxylabs_ai_studio.apps.ai_map import AiMap
2+
3+
4+
map = AiMap(api_key="<API_KEY>")
5+
6+
payload = {
7+
"url": "https://career.oxylabs.io",
8+
"user_prompt": "job ad pages",
9+
"return_sources_limit": 10,
10+
"max_depth": 1,
11+
"geo_location": None,
12+
"render_javascript": False,
13+
}
14+
result = map.map(**payload)
15+
print(result.data)

readme.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,29 @@ print(result.data)
130130
- `return_content` (bool): Whether to return markdown contents in results (default: True)
131131
- `geo_location` (str): search proxy location in ISO2 format.
132132

133+
### Map (`AiMap.map`)
134+
```python
135+
from oxylabs_ai_studio.apps.ai_map import AiMap
136+
137+
138+
map = AiMap(api_key="<API_KEY>")
139+
payload = {
140+
"url": "https://career.oxylabs.io",
141+
"user_prompt": "job ad pages",
142+
"return_sources_limit": 10,
143+
"max_depth": 1,
144+
"geo_location": None,
145+
"render_javascript": False,
146+
}
147+
result = map.map(**payload)
148+
print(result.data)
149+
```
150+
**Parameters:**
151+
- `url` (str): Starting URL to crawl (**required**)
152+
- `user_prompt` (str): Natural language prompt to guide extraction (**required**)
153+
- `render_javascript` (bool): Render JavaScript (default: False)
154+
- `return_sources_limit` (int): Max number of sources to return (default: 25)
155+
- `geo_location` (str): proxy location in ISO2 format.
156+
133157
---
134158
See the [examples](https://github.com/oxylabs/oxylabs-ai-studio-py/tree/main/examples) folder for usage examples of each method. Each method has corresponding async version.

0 commit comments

Comments
 (0)