Python API wrapper for darksearch.io
Project description
Python API wrapper for darksearch.io
Install
pip install darksearch
Usage
import darksearch
"""
`timeout`, `headers`, and `proxies` are optional
timeout = 10
proxies = {
"http": "http://127.0.0.1:8080"
}
headers = {
"User-Agent": "Chrome/57.0.2987.133"
}
"""
client = darksearch.Client(timeout=30, headers=None, proxies=None)
results = client.search("query")
"""
`results` is a JSON dict object like this
{
"total": int,
"per_page": int,
"current_page": int,
"last_page": int,
"from": int,
"to": int,
"data": [
{
"title": string,
"link": string,
"description": string
}
]
}
"""
results = client.search("query", page=2)
"""
`results` is a JSON dict object like this
{
"total": int,
"per_page": int,
"current_page": 2,
"last_page": int,
"from": int,
"to": int,
"data": [
{
"title": string,
"link": string,
"description": string
}
]
}
"""
results = client.search("query", pages=2)
"""
`results` is a list of JSON dict objects like this
[
{
"total": int,
"per_page": int,
"current_page": 1,
"last_page": int,
"from": int,
"to": int,
"data": [
{
"title": string,
"link": string,
"description": string
}
]
},
...
]
"""
results = client.search("query", pages=2, wait=2)
"""
`wait` is the seconds between requests (DarkSearch's API is limited to 30 requests per minute.)
`results` is a list of JSON dict objects
[
{
"total": int,
"per_page": int,
"current_page": 1,
"last_page": int,
"from": int,
"to": int,
"data": [
{
"title": string,
"link": string,
"description": string
}
]
},
...
]
"""
crawling_status = darksearch.crawling_status()
"""
`crawling_status` is a integer of pages that have been indexed
"""
Testing
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
DarkSearch-1.4.1.tar.gz
(3.5 kB
view hashes)
Built Distributions
Close
Hashes for DarkSearch-1.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 455604093b55d75047dbea45cdc3cfdfbc68f674a467f548a86fadfdcb21d8a8 |
|
MD5 | c95501584a99ab251feb56ce071a9bfc |
|
BLAKE2b-256 | bed9273ce7c4e9ee0c948e8585832eadf7e72258eea13eb4f54b24e5e902570c |
Close
Hashes for DarkSearch-1.4.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f533972cc8374834c3fb2ba79ae2ca8c6ad186f03e69b33ad1bb8f860f78126 |
|
MD5 | b3e6ca270a4e213c46eceb60e49d4659 |
|
BLAKE2b-256 | d7022fe99dbdb4e7e5944c4e6edde45a79b76b6f0810ac1d3626b7c8063b6c11 |