polarcrawl 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- polarcrawl-0.1.0/.gitignore +3 -0
- polarcrawl-0.1.0/LICENSE +21 -0
- polarcrawl-0.1.0/PKG-INFO +71 -0
- polarcrawl-0.1.0/README.md +57 -0
- polarcrawl-0.1.0/pyproject.toml +19 -0
- polarcrawl-0.1.0/src/polarcrawl/__init__.py +38 -0
polarcrawl-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PolarCrawl
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: polarcrawl
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Run PolarCrawl's ready-made scrapers (WhatsApp, Telegram, jobs, Instagram, Airbnb, ads) from Python and get clean rows back.
|
|
5
|
+
Project-URL: Homepage, https://polarcrawl.com
|
|
6
|
+
Project-URL: Actors, https://polarcrawl.com/actors
|
|
7
|
+
Author-email: PolarCrawl <hello@polarcrawl.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: airbnb,apify,data-api,instagram,jobs,scraper,telegram,web-scraping,whatsapp
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Requires-Dist: apify-client>=3.6.0
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# polarcrawl
|
|
16
|
+
|
|
17
|
+
Run [PolarCrawl](https://polarcrawl.com)'s ready-made scrapers from Python and get clean rows back: WhatsApp, Telegram, jobs, Instagram, Airbnb, ads and more.
|
|
18
|
+
|
|
19
|
+
Every actor is pay per result: you pay a fixed price for each row through your Apify account, never for servers. Apify's free plan includes monthly credit.
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
pip install polarcrawl
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
You need an Apify API token. Get one at [console.apify.com/settings/integrations](https://console.apify.com/settings/integrations) and set it as `APIFY_TOKEN`, or pass `token=`.
|
|
28
|
+
|
|
29
|
+
## Run an actor
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from polarcrawl import run
|
|
33
|
+
|
|
34
|
+
jobs = run('vero-api/jobs-scraper', {
|
|
35
|
+
'searchTerm': 'data engineer',
|
|
36
|
+
'country': 'us',
|
|
37
|
+
'location': 'New York, NY',
|
|
38
|
+
'maxResults': 50,
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
print(len(jobs), jobs[0])
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`run` waits for the actor to finish and returns its rows. It also takes Apify's run options, for example a spending cap:
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from decimal import Decimal
|
|
48
|
+
|
|
49
|
+
run('vero-api/whatsapp-scraper', {'numbers': ['+1 415 555 0178']}, max_total_charge_usd=Decimal('1'))
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## List the actors
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from polarcrawl import list_actors
|
|
56
|
+
|
|
57
|
+
for actor in list_actors():
|
|
58
|
+
print(actor['id'], actor['price']['perThousandUsd']['free'], actor['tagline'])
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Each actor comes with its price, input fields, an example input and its output fields, read live from [polarcrawl.com/actors.json](https://polarcrawl.com/actors.json).
|
|
62
|
+
|
|
63
|
+
## For AI agents
|
|
64
|
+
|
|
65
|
+
Connect every actor to Claude, ChatGPT, Grok Build/Cursor or VS Code through the Apify MCP server: [polarcrawl.com/mcp](https://polarcrawl.com/mcp).
|
|
66
|
+
|
|
67
|
+
## Links
|
|
68
|
+
|
|
69
|
+
- All actors: [polarcrawl.com/actors](https://polarcrawl.com/actors)
|
|
70
|
+
- Pricing: [polarcrawl.com/pricing](https://polarcrawl.com/pricing)
|
|
71
|
+
- Contact: [hello@polarcrawl.com](mailto:hello@polarcrawl.com)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# polarcrawl
|
|
2
|
+
|
|
3
|
+
Run [PolarCrawl](https://polarcrawl.com)'s ready-made scrapers from Python and get clean rows back: WhatsApp, Telegram, jobs, Instagram, Airbnb, ads and more.
|
|
4
|
+
|
|
5
|
+
Every actor is pay per result: you pay a fixed price for each row through your Apify account, never for servers. Apify's free plan includes monthly credit.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pip install polarcrawl
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
You need an Apify API token. Get one at [console.apify.com/settings/integrations](https://console.apify.com/settings/integrations) and set it as `APIFY_TOKEN`, or pass `token=`.
|
|
14
|
+
|
|
15
|
+
## Run an actor
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
from polarcrawl import run
|
|
19
|
+
|
|
20
|
+
jobs = run('vero-api/jobs-scraper', {
|
|
21
|
+
'searchTerm': 'data engineer',
|
|
22
|
+
'country': 'us',
|
|
23
|
+
'location': 'New York, NY',
|
|
24
|
+
'maxResults': 50,
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
print(len(jobs), jobs[0])
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`run` waits for the actor to finish and returns its rows. It also takes Apify's run options, for example a spending cap:
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from decimal import Decimal
|
|
34
|
+
|
|
35
|
+
run('vero-api/whatsapp-scraper', {'numbers': ['+1 415 555 0178']}, max_total_charge_usd=Decimal('1'))
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## List the actors
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from polarcrawl import list_actors
|
|
42
|
+
|
|
43
|
+
for actor in list_actors():
|
|
44
|
+
print(actor['id'], actor['price']['perThousandUsd']['free'], actor['tagline'])
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Each actor comes with its price, input fields, an example input and its output fields, read live from [polarcrawl.com/actors.json](https://polarcrawl.com/actors.json).
|
|
48
|
+
|
|
49
|
+
## For AI agents
|
|
50
|
+
|
|
51
|
+
Connect every actor to Claude, ChatGPT, Grok Build/Cursor or VS Code through the Apify MCP server: [polarcrawl.com/mcp](https://polarcrawl.com/mcp).
|
|
52
|
+
|
|
53
|
+
## Links
|
|
54
|
+
|
|
55
|
+
- All actors: [polarcrawl.com/actors](https://polarcrawl.com/actors)
|
|
56
|
+
- Pricing: [polarcrawl.com/pricing](https://polarcrawl.com/pricing)
|
|
57
|
+
- Contact: [hello@polarcrawl.com](mailto:hello@polarcrawl.com)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "polarcrawl"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Run PolarCrawl's ready-made scrapers (WhatsApp, Telegram, jobs, Instagram, Airbnb, ads) from Python and get clean rows back."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
authors = [{ name = "PolarCrawl", email = "hello@polarcrawl.com" }]
|
|
9
|
+
requires-python = ">=3.11"
|
|
10
|
+
dependencies = ["apify-client>=3.6.0"]
|
|
11
|
+
keywords = ["scraper", "web-scraping", "apify", "whatsapp", "telegram", "jobs", "instagram", "airbnb", "data-api"]
|
|
12
|
+
|
|
13
|
+
[project.urls]
|
|
14
|
+
Homepage = "https://polarcrawl.com"
|
|
15
|
+
Actors = "https://polarcrawl.com/actors"
|
|
16
|
+
|
|
17
|
+
[build-system]
|
|
18
|
+
requires = ["hatchling"]
|
|
19
|
+
build-backend = "hatchling.build"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Run PolarCrawl's ready-made scrapers from Python and get clean rows back."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import os
|
|
7
|
+
from typing import Any
|
|
8
|
+
from urllib.request import Request, urlopen
|
|
9
|
+
|
|
10
|
+
from apify_client import ApifyClient
|
|
11
|
+
|
|
12
|
+
__all__ = ['list_actors', 'run']
|
|
13
|
+
|
|
14
|
+
CATALOG_URL = 'https://polarcrawl.com/actors.json'
|
|
15
|
+
TOKEN_HELP = 'Pass token= or set APIFY_TOKEN. Get a token at https://console.apify.com/settings/integrations'
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def list_actors() -> list[dict[str, Any]]:
|
|
19
|
+
"""Every PolarCrawl actor, with prices, inputs and output fields, read live from polarcrawl.com."""
|
|
20
|
+
# Cloudflare's browser check refuses urllib's default "Python-urllib" user agent.
|
|
21
|
+
with urlopen(Request(CATALOG_URL, headers={'User-Agent': 'polarcrawl-python'})) as res:
|
|
22
|
+
return json.load(res)['actors']
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def run(actor_id: str, run_input: dict[str, Any], *, token: str | None = None, **options: Any) -> list[dict[str, Any]]:
|
|
26
|
+
"""Run an actor, wait for it to finish and return its result rows.
|
|
27
|
+
|
|
28
|
+
actor_id is the id from list_actors(), e.g. "vero-api/jobs-scraper". Extra keyword arguments go to
|
|
29
|
+
Apify's ActorClient.call, e.g. max_total_charge_usd=Decimal('1') to cap what the run can spend.
|
|
30
|
+
"""
|
|
31
|
+
token = token or os.environ.get('APIFY_TOKEN')
|
|
32
|
+
if not token:
|
|
33
|
+
raise ValueError(f'No Apify token. {TOKEN_HELP}')
|
|
34
|
+
client = ApifyClient(token)
|
|
35
|
+
finished = client.actor(actor_id).call(run_input=run_input, **{'logger': None, **options})
|
|
36
|
+
if finished is None:
|
|
37
|
+
raise RuntimeError(f'{actor_id} did not finish.')
|
|
38
|
+
return client.dataset(finished.default_dataset_id).list_items().items
|