| 1 |
Usage v1 |
| 2 |
======== |
| 3 |
|
| 4 |
The Censys Search API provides functionality for interacting with Censys resources such as Data, and for viewing Account information such as query quota. |
| 5 |
|
| 6 |
There is one API options that this library provides access to: |
| 7 |
|
| 8 |
- :attr:`data <censys.search.v1.CensysData>` - Returns collections of scan series whose metadata includes a description of the data collected in the series and links to the individual scan results. |
| 9 |
|
| 10 |
More details about each option can be found in the `Censys API documentation <https://search.censys.io/api>`__. A list of index fields can be found in the `Censys API definitions page <https://search.censys.io/certificates/help>`__. |
| 11 |
|
| 12 |
.. note:: |
| 13 |
|
| 14 |
Please note that the Censys Search Certificates v1 API is being deprecated. Please use the :ref:`CensysCerts (v2) index <usage-v2:Usage v2>` for this functionality. |
| 15 |
|
| 16 |
``data`` |
| 17 |
-------- |
| 18 |
|
| 19 |
Below we show an example using the :attr:`CensysData <censys.search.v1.CensysData>` index. |
| 20 |
|
| 21 |
.. code:: python |
| 22 |
|
| 23 |
from censys.search import CensysData |
| 24 |
|
| 25 |
c = CensysData() |
| 26 |
|
| 27 |
# View a specific result from a specific series |
| 28 |
result = c.view_result("ipv4_2018", "20200818") |
| 29 |
print(result) |
| 30 |
|
| 31 |
``account`` |
| 32 |
----------- |
| 33 |
|
| 34 |
Below we show an example using the :attr:`CensysHosts <censys.search.v2.CensysHosts>` index. |
| 35 |
|
| 36 |
.. code:: python |
| 37 |
|
| 38 |
from censys.search import CensysHosts |
| 39 |
|
| 40 |
c = CensysHosts() |
| 41 |
|
| 42 |
# Gets account data |
| 43 |
account = c.account() |
| 44 |
print(account) |
| 45 |
|
| 46 |
# Gets account quota |
| 47 |
quota = c.quota() |
| 48 |
print(quota) |