Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

censysx

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

censysx

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Censysx

Gem Version

A Censys Search v2 API wrapper for Ruby. 💎

Installation

gem install censysx

Usage

Initialize the API:

require "censys"

api = Censys::API.new(id, secret)

You can initialize the API by using $CENSYS_ID and $CENSYS_SECRET environment variables:

# in this case, it tries to load ID and secret from ENV
# - ENV["CENSYS_ID"] for the ID
# - ENV["CENSYS_SECRET"] for the secret
api = Censys::API.new

View:

response = api.view("1.1.1.1")
response = api.view("1.1.1.1", at_time: "2021-03-01T00:00:00.000000Z")

Search:

response = api.search(query, cursor: cursor)

Search with cursor:

cursor = nil

loop do
  response = api.search(query, cursor: cursor)

  links = response.dig("result", "links")
  cursor = links["next"]
  break if cursor == ""
end

Aggregate:

response = api.aggregate(query, field)
response = api.aggregate(query, field, num_buckets: num_buckets)

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 12 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc