Skip to main content

I just started using Censys Search and want to export search results which I understand requires using the Censys CLI. So I’ve installed https://github.com/censys/censys-python and created a PAT at https://accounts.censys.io/settings/personal-access-tokens?org=xxx-xxxxxx but when attempting to authenticate I get a “failed to authenticate” error.

 

Your documentation at https://docs.censys.com/reference/get-started is unclear in what the "Censys API ID” is, it sounds like it’s the Organization ID, which I tried to use. I’ve also tried the token name, and my email address. None seem to work.

 

Here is the output:

 

❯ censys config

Censys API ID: xxx-xxxxxx

Censys API Secret: censys_9xxxxxxx7R_JbsxxxxxxxxxxxGS

Do you want color output? ny/n]: y

Failed to authenticate

 

So I’m asking for clarity on what the Censys API ID is supposed to be. And if it is the Org ID, than any other ideas on why it’s failing to authenticate? I already checked RBAC and my user does have “API Access” enabled.

Hey atw, that Censys Python git repo you linked is only compatible with our Legacy Search product. It will not work with Platform API creds, which are what you have.

You should be using the Platform API endpoints provided in the docs page you linked. An example search query cURL including your orgID and PAT would be as follows:

curl --request POST \
--url 'https://api.platform.censys.io/v3/global/search/query?organization_id=1234' \
--header 'accept: application/json' \
--header 'authorization: 5678' \
--header 'content-type: application/json' \
--data '
{
"query": "host.ip: 1.1.1.1/16"
}
'

Additional developer support for Platform in the form of SDKs and a tool similar to Censys Python are coming soon.


Reply