Builtwith (builtwith v0.1.1)

An unofficial module for interacting with the Builtwith API.

Please note: This module is not an official Builtwith API client and is not affiliated with or endorsed by Builtwith. It is a third-party implementation.

This module provides functions to make requests to the Builtwith API and extract specific data from the JSON response.

To use this module, you need to have a valid Builtwith API key (bwpass).

Summary

Functions

This function takes a list of JSON objects (results from a Builtwith API request) and returns the value of the 'Attributes' field from the first object where this field is found.

This function takes a JSON object and returns the 'IsDB' field from the 'Result' field of the JSON object.

This function takes the result of a Builtwith API request and returns the value of the 'Lookup' field, which is the domain being looked up.

This function takes a list of JSON objects (results from a Builtwith API request) and returns the value of the 'Meta' field from the first object where this field is found.

This function takes a list of JSON objects (results from a Builtwith API request) and returns the value of the 'Spend' field from the 'Result' object of the first JSON object where the 'Result' field is found.

This function takes a list of JSON objects (results from a Builtwith API request) and returns a list of all 'SubDomain' values found in the 'Paths' field of the 'Result' object.

This function takes a list of JSON objects (results from a Builtwith API request) and returns a map where the keys are the 'Tag' values and the values are lists of technologies with that 'Tag' value, extracted from the 'Technologies' field in the 'Paths' array of the 'Result' object.

Functions

Link to this function

get_attributes(builtwithjson)

This function takes a list of JSON objects (results from a Builtwith API request) and returns the value of the 'Attributes' field from the first object where this field is found.

Examples

iex> Builtwith.get_attributes([%{"Attributes" => %{"key" => "value"}}])
%{"key" => "value"}

If the 'Attributes' field is not found in any of the JSON objects in the list, the function returns nil.

Link to this function

get_db_status(builtwithjson)

This function takes a JSON object and returns the 'IsDB' field from the 'Result' field of the JSON object.

Examples

iex> Builtwith.get_db_status([%{"Result" => %{"IsDB" => true}}])
true

Possible return values are true, false, "Misleading", or nil if the 'Result' or 'IsDB' field is not found.

Link to this function

get_lookup(builtwithjson)

This function takes the result of a Builtwith API request and returns the value of the 'Lookup' field, which is the domain being looked up.

Examples

iex> results = [%{"Lookup" => "example.com"}]
iex> Builtwith.get_lookup(results)
"example.com"

If the 'Lookup' field is not found, the function returns nil.

Link to this function

get_meta(builtwithjson)

This function takes a list of JSON objects (results from a Builtwith API request) and returns the value of the 'Meta' field from the first object where this field is found.

Examples

iex> Builtwith.get_meta([%{"Meta" => %{"key" => "value"}}])
%{"key" => "value"}

If the 'Meta' field is not found in any of the JSON objects in the list, the function returns nil.

Link to this function

get_results(response)

Link to this function

get_spend(builtwithjson)

This function takes a list of JSON objects (results from a Builtwith API request) and returns the value of the 'Spend' field from the 'Result' object of the first JSON object where the 'Result' field is found.

Examples

iex> Builtwith.get_spend([%{"Result" => %{"Spend" => 100}}])
100

If the 'Result' or 'Spend' field is not found in any of the JSON objects in the list, the function returns nil.

Link to this function

get_subdomains(builtwithjson)

This function takes a list of JSON objects (results from a Builtwith API request) and returns a list of all 'SubDomain' values found in the 'Paths' field of the 'Result' object.

Examples

iex> Builtwith.get_subdomains([%{"Result" => %{"Paths" => [%{"SubDomain" => "sub1.example.com"}, %{"SubDomain" => "sub2.example.com"}]}}])
["sub1.example.com", "sub2.example.com"]

If no 'SubDomain' values are found, or if the 'Result' or 'Paths' fields are not found, the function returns nil.

Link to this function

get_technologies(builtwithjson)

This function takes a list of JSON objects (results from a Builtwith API request) and returns a map where the keys are the 'Tag' values and the values are lists of technologies with that 'Tag' value, extracted from the 'Technologies' field in the 'Paths' array of the 'Result' object.

Examples

iex> Builtwith.get_technologies([%{"Result" => %{"Paths" => [%{"Technologies" => [%{"Tag" => "tag1", "Name" => "tech1"}, %{"Tag" => "tag1", "Name" => "tech2"}, %{"Tag" => "tag2", "Name" => "tech3"}]}]}}])
%{"tag1" => [%{"Tag" => "tag1", "Name" => "tech1"}, %{"Tag" => "tag1", "Name" => "tech2"}], "tag2" => [%{"Tag" => "tag2", "Name" => "tech3"}]}

If the 'Result', 'Paths', or 'Technologies' field is not found, or if no technologies are present, the function returns an empty map.

Link to this function

make_request(list)