0.0
No commit activity in last 3 years
No release in over 3 years
SecurityTrails API wrapper for Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 0.8
~> 13.0
~> 3.9
~> 5.0
~> 3.7
 Project Readme

SecurityTrails

Gem Version Build Status Codacy Badge Coverage Status

SecurityTrails API wrapper for Ruby.

Installation

Add this line to your application's Gemfile:

gem 'securitytrails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install securitytrails

Usage

require "securitytrails"

# When given nothing, it tries to load your API key from ENV["SECURITYTRAILS_API_KEY"]
api = SecurityTrails::API.new
# or you can pass your API key as an argument
api = SecurityTrails::API.new(YOUR_API_KEY)

# General
# https://docs.securitytrails.com/reference#general
api.ping
api.usage

# Domain details
# https://docs.securitytrails.com/v1.0/reference#domains
api.domain.get_by_hostname("github.com")
api.domain.get_subdomains("github.com")
api.domain.get_tags("github.com")
api.domain.get_associated_domains("github.com")
api.domain.get_whois("github.com")

# Domain search
# https://docs.securitytrails.com/v1.0/reference#domain-search
api.domains.search(
    filter: {
        ipv4: "1.1.1.1"
})
api.domains.stats(
    filter: {
        ipv4: "1.1.1.1"
    }
)

# History
# https://docs.securitytrails.com/v1.0/reference#history
api.history.get_dns_history("github.com", type: "a")
api.history.get_all_dns_history("github.com", type: "a")
api.history.get_whois_history("github.com")

# IPs
# https://docs.securitytrails.com/v1.0/reference#ips
api.ips.explore("8.8.8.8")
api.ips.search("ptr_part = 'ns1'")
api.ips.stats("ptr_part = 'amazon.com'")

# Feeds
# https://docs.securitytrails.com/v1.0/reference#feeds
api.feeds.domains("new")
api.feeds.domains("new", tld: "jp")

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ninoseki/securitytrails.

License

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