blocket-api 0.2.6__tar.gz → 0.2.7__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.
- {blocket_api-0.2.6 → blocket_api-0.2.7}/PKG-INFO +11 -7
- {blocket_api-0.2.6 → blocket_api-0.2.7}/README.md +9 -5
- {blocket_api-0.2.6 → blocket_api-0.2.7}/blocket_api/blocket.py +57 -5
- {blocket_api-0.2.6 → blocket_api-0.2.7}/blocket_api.egg-info/PKG-INFO +11 -7
- {blocket_api-0.2.6 → blocket_api-0.2.7}/blocket_api.egg-info/requires.txt +1 -1
- {blocket_api-0.2.6 → blocket_api-0.2.7}/pyproject.toml +2 -2
- {blocket_api-0.2.6 → blocket_api-0.2.7}/LICENSE +0 -0
- {blocket_api-0.2.6 → blocket_api-0.2.7}/blocket_api/__init__.py +0 -0
- {blocket_api-0.2.6 → blocket_api-0.2.7}/blocket_api/qasa.py +0 -0
- {blocket_api-0.2.6 → blocket_api-0.2.7}/blocket_api.egg-info/SOURCES.txt +0 -0
- {blocket_api-0.2.6 → blocket_api-0.2.7}/blocket_api.egg-info/dependency_links.txt +0 -0
- {blocket_api-0.2.6 → blocket_api-0.2.7}/blocket_api.egg-info/top_level.txt +0 -0
- {blocket_api-0.2.6 → blocket_api-0.2.7}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: blocket_api
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.7
|
|
4
4
|
Summary: A python API wrapper for blocket.se
|
|
5
5
|
Author-email: dunderrrrrr <emil.bjorkroth@gmail.com>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -8,10 +8,10 @@ Description-Content-Type: text/markdown
|
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Requires-Dist: httpx>=0.27.0
|
|
10
10
|
Requires-Dist: pre-commit>=3.7.1
|
|
11
|
-
Requires-Dist: ruff>=0.5.2
|
|
12
11
|
Requires-Dist: pytest>=8.2.2
|
|
13
12
|
Requires-Dist: respx>=0.21.1
|
|
14
13
|
Requires-Dist: mypy>=1.15.0
|
|
14
|
+
Requires-Dist: ruff>=0.12.3
|
|
15
15
|
Dynamic: license-file
|
|
16
16
|
|
|
17
17
|
# BlocketAPI
|
|
@@ -25,9 +25,11 @@ BlocketAPI allows users to query saved searches, known as "Bevakningar", on [blo
|
|
|
25
25
|
## ✨ Features
|
|
26
26
|
|
|
27
27
|
- List saved searches, called "Bevakningar".
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
28
|
+
- Get listings from all or a specific saved search.
|
|
29
|
+
- Search for anything on Blocket with filters for region and category.
|
|
30
|
+
- Advanced search for vehicles with multiple filters.
|
|
31
|
+
- Get vehicle information and price evaluation.
|
|
32
|
+
- Search for homes with filters for city, home type and more.
|
|
31
33
|
|
|
32
34
|
## 🧑💻️ Install
|
|
33
35
|
|
|
@@ -122,7 +124,8 @@ Make a custom search through out all of blocked. A region can be passed in as pa
|
|
|
122
124
|
|
|
123
125
|
Parameters:
|
|
124
126
|
- `search_query` (`str`, required) - A string to search for.
|
|
125
|
-
- `region` (`
|
|
127
|
+
- `region` (`enum`, optional) - Filter results on a region, default is all of Sweden.
|
|
128
|
+
- `category` (`enum`, optional) - Filter for a specific category, ex. `Category.for_hemmet`.
|
|
126
129
|
- `limit` (`int`, optional) - Limit number of results returned, max is 99.
|
|
127
130
|
|
|
128
131
|
```py
|
|
@@ -184,7 +187,7 @@ Query price evaluation for a specific vehicle by using cars registration number
|
|
|
184
187
|
|
|
185
188
|
- `registration_number` (`str`, required) - Registration number of the vehicle.
|
|
186
189
|
```py
|
|
187
|
-
>>> api.price_eval("ABC123)
|
|
190
|
+
>>> api.price_eval("ABC123")
|
|
188
191
|
{
|
|
189
192
|
"registration_number": "ABC123",
|
|
190
193
|
"private_valuation": 108155,
|
|
@@ -208,6 +211,7 @@ Query home listings from [bostad.blocket.se](https://bostad.blocket.se/).
|
|
|
208
211
|
- `offset` (`int`, optional) - Offset for results, ex. `60`.
|
|
209
212
|
|
|
210
213
|
```py
|
|
214
|
+
>>> from blocket_api.qasa import HomeType, OrderBy
|
|
211
215
|
>>> api.home_search(
|
|
212
216
|
city="Stockholm",
|
|
213
217
|
type=HomeType.apartment,
|
|
@@ -9,9 +9,11 @@ BlocketAPI allows users to query saved searches, known as "Bevakningar", on [blo
|
|
|
9
9
|
## ✨ Features
|
|
10
10
|
|
|
11
11
|
- List saved searches, called "Bevakningar".
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
12
|
+
- Get listings from all or a specific saved search.
|
|
13
|
+
- Search for anything on Blocket with filters for region and category.
|
|
14
|
+
- Advanced search for vehicles with multiple filters.
|
|
15
|
+
- Get vehicle information and price evaluation.
|
|
16
|
+
- Search for homes with filters for city, home type and more.
|
|
15
17
|
|
|
16
18
|
## 🧑💻️ Install
|
|
17
19
|
|
|
@@ -106,7 +108,8 @@ Make a custom search through out all of blocked. A region can be passed in as pa
|
|
|
106
108
|
|
|
107
109
|
Parameters:
|
|
108
110
|
- `search_query` (`str`, required) - A string to search for.
|
|
109
|
-
- `region` (`
|
|
111
|
+
- `region` (`enum`, optional) - Filter results on a region, default is all of Sweden.
|
|
112
|
+
- `category` (`enum`, optional) - Filter for a specific category, ex. `Category.for_hemmet`.
|
|
110
113
|
- `limit` (`int`, optional) - Limit number of results returned, max is 99.
|
|
111
114
|
|
|
112
115
|
```py
|
|
@@ -168,7 +171,7 @@ Query price evaluation for a specific vehicle by using cars registration number
|
|
|
168
171
|
|
|
169
172
|
- `registration_number` (`str`, required) - Registration number of the vehicle.
|
|
170
173
|
```py
|
|
171
|
-
>>> api.price_eval("ABC123)
|
|
174
|
+
>>> api.price_eval("ABC123")
|
|
172
175
|
{
|
|
173
176
|
"registration_number": "ABC123",
|
|
174
177
|
"private_valuation": 108155,
|
|
@@ -192,6 +195,7 @@ Query home listings from [bostad.blocket.se](https://bostad.blocket.se/).
|
|
|
192
195
|
- `offset` (`int`, optional) - Offset for results, ex. `60`.
|
|
193
196
|
|
|
194
197
|
```py
|
|
198
|
+
>>> from blocket_api.qasa import HomeType, OrderBy
|
|
195
199
|
>>> api.home_search(
|
|
196
200
|
city="Stockholm",
|
|
197
201
|
type=HomeType.apartment,
|
|
@@ -46,6 +46,52 @@ class Region(Enum):
|
|
|
46
46
|
örebro = 8
|
|
47
47
|
|
|
48
48
|
|
|
49
|
+
class Category(Enum):
|
|
50
|
+
fordon = 1000
|
|
51
|
+
bilar = 1020
|
|
52
|
+
bildelar_biltillbehor = 1040
|
|
53
|
+
batar = 1060
|
|
54
|
+
batdelar_tillbehor = 1080
|
|
55
|
+
husvagnar_husbilar = 1100
|
|
56
|
+
mopeder_a_traktor = 1120
|
|
57
|
+
motorcyklar = 1140
|
|
58
|
+
mc_delar_tillbehor = 1160
|
|
59
|
+
lastbil_truck_entreprenad = 1220
|
|
60
|
+
skogs_lantbruksmaskiner = 1240
|
|
61
|
+
snoskotrar = 1180
|
|
62
|
+
snoskoterdelar_tillbehor = 1200
|
|
63
|
+
for_hemmet = 2000
|
|
64
|
+
bygg_tradgard = 2020
|
|
65
|
+
mobler_heminredning = 2040
|
|
66
|
+
husgerad_vitvaror = 2060
|
|
67
|
+
verktyg = 2026
|
|
68
|
+
bostad = 3000
|
|
69
|
+
lagenheter = 3020
|
|
70
|
+
villor = 3100
|
|
71
|
+
radhus = 3120
|
|
72
|
+
tomter = 3060
|
|
73
|
+
gardar = 3070
|
|
74
|
+
fritidsboende = 3040
|
|
75
|
+
utland = 3080
|
|
76
|
+
personligt = 4000
|
|
77
|
+
klader_skor = 4080
|
|
78
|
+
accessoarer_klockor = 4060
|
|
79
|
+
barnklader_skor = 4020
|
|
80
|
+
barnartiklar_leksaker = 4040
|
|
81
|
+
elektronik = 5000
|
|
82
|
+
datorer_tv_spel = 5020
|
|
83
|
+
ljud_bild = 5040
|
|
84
|
+
telefoner_tillbehor = 5060
|
|
85
|
+
fritid_hobby = 6000
|
|
86
|
+
biljetter_resor = 6020
|
|
87
|
+
bocker_studentlitteratur = 6040
|
|
88
|
+
cyklar = 6060
|
|
89
|
+
djur = 6080
|
|
90
|
+
hobby_samlarprylar = 6100
|
|
91
|
+
hastar_ridsport = 6120
|
|
92
|
+
jakt_fiske = 6140
|
|
93
|
+
|
|
94
|
+
|
|
49
95
|
MAKE_OPTIONS = Literal[
|
|
50
96
|
"Audi",
|
|
51
97
|
"BMW",
|
|
@@ -188,7 +234,11 @@ class BlocketAPI:
|
|
|
188
234
|
|
|
189
235
|
@public_token
|
|
190
236
|
def custom_search(
|
|
191
|
-
self,
|
|
237
|
+
self,
|
|
238
|
+
search_query: str,
|
|
239
|
+
region: Region = Region.hela_sverige,
|
|
240
|
+
category: Category | None = None,
|
|
241
|
+
limit: int = 99,
|
|
192
242
|
) -> dict:
|
|
193
243
|
"""
|
|
194
244
|
Do a custom search through out all of Blocket.
|
|
@@ -199,10 +249,12 @@ class BlocketAPI:
|
|
|
199
249
|
if limit > 99:
|
|
200
250
|
raise LimitError("Limit cannot be greater than 99.")
|
|
201
251
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
252
|
+
url = f"{BASE_URL}/search_bff/v2/content?lim={limit}&q={search_query}&r={region.value}&status=active"
|
|
253
|
+
|
|
254
|
+
if category:
|
|
255
|
+
url += f"&cg={category.value}"
|
|
256
|
+
|
|
257
|
+
return _make_request(url=url, token=self.token).json()
|
|
206
258
|
|
|
207
259
|
@public_token
|
|
208
260
|
def motor_search(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: blocket_api
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.7
|
|
4
4
|
Summary: A python API wrapper for blocket.se
|
|
5
5
|
Author-email: dunderrrrrr <emil.bjorkroth@gmail.com>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -8,10 +8,10 @@ Description-Content-Type: text/markdown
|
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Requires-Dist: httpx>=0.27.0
|
|
10
10
|
Requires-Dist: pre-commit>=3.7.1
|
|
11
|
-
Requires-Dist: ruff>=0.5.2
|
|
12
11
|
Requires-Dist: pytest>=8.2.2
|
|
13
12
|
Requires-Dist: respx>=0.21.1
|
|
14
13
|
Requires-Dist: mypy>=1.15.0
|
|
14
|
+
Requires-Dist: ruff>=0.12.3
|
|
15
15
|
Dynamic: license-file
|
|
16
16
|
|
|
17
17
|
# BlocketAPI
|
|
@@ -25,9 +25,11 @@ BlocketAPI allows users to query saved searches, known as "Bevakningar", on [blo
|
|
|
25
25
|
## ✨ Features
|
|
26
26
|
|
|
27
27
|
- List saved searches, called "Bevakningar".
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
28
|
+
- Get listings from all or a specific saved search.
|
|
29
|
+
- Search for anything on Blocket with filters for region and category.
|
|
30
|
+
- Advanced search for vehicles with multiple filters.
|
|
31
|
+
- Get vehicle information and price evaluation.
|
|
32
|
+
- Search for homes with filters for city, home type and more.
|
|
31
33
|
|
|
32
34
|
## 🧑💻️ Install
|
|
33
35
|
|
|
@@ -122,7 +124,8 @@ Make a custom search through out all of blocked. A region can be passed in as pa
|
|
|
122
124
|
|
|
123
125
|
Parameters:
|
|
124
126
|
- `search_query` (`str`, required) - A string to search for.
|
|
125
|
-
- `region` (`
|
|
127
|
+
- `region` (`enum`, optional) - Filter results on a region, default is all of Sweden.
|
|
128
|
+
- `category` (`enum`, optional) - Filter for a specific category, ex. `Category.for_hemmet`.
|
|
126
129
|
- `limit` (`int`, optional) - Limit number of results returned, max is 99.
|
|
127
130
|
|
|
128
131
|
```py
|
|
@@ -184,7 +187,7 @@ Query price evaluation for a specific vehicle by using cars registration number
|
|
|
184
187
|
|
|
185
188
|
- `registration_number` (`str`, required) - Registration number of the vehicle.
|
|
186
189
|
```py
|
|
187
|
-
>>> api.price_eval("ABC123)
|
|
190
|
+
>>> api.price_eval("ABC123")
|
|
188
191
|
{
|
|
189
192
|
"registration_number": "ABC123",
|
|
190
193
|
"private_valuation": 108155,
|
|
@@ -208,6 +211,7 @@ Query home listings from [bostad.blocket.se](https://bostad.blocket.se/).
|
|
|
208
211
|
- `offset` (`int`, optional) - Offset for results, ex. `60`.
|
|
209
212
|
|
|
210
213
|
```py
|
|
214
|
+
>>> from blocket_api.qasa import HomeType, OrderBy
|
|
211
215
|
>>> api.home_search(
|
|
212
216
|
city="Stockholm",
|
|
213
217
|
type=HomeType.apartment,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "blocket_api"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.7"
|
|
4
4
|
description = "A python API wrapper for blocket.se"
|
|
5
5
|
authors = [{name = "dunderrrrrr", email = "emil.bjorkroth@gmail.com"}]
|
|
6
6
|
readme = "README.md"
|
|
@@ -8,10 +8,10 @@ requires-python = ">=3.10"
|
|
|
8
8
|
dependencies = [
|
|
9
9
|
"httpx>=0.27.0",
|
|
10
10
|
"pre-commit>=3.7.1",
|
|
11
|
-
"ruff>=0.5.2",
|
|
12
11
|
"pytest>=8.2.2",
|
|
13
12
|
"respx>=0.21.1",
|
|
14
13
|
"mypy>=1.15.0",
|
|
14
|
+
"ruff>=0.12.3",
|
|
15
15
|
]
|
|
16
16
|
|
|
17
17
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|