Skip to main content

File Intel | Node.js SDK

The File Intel service enables you to submit a file's hash and get the file's attributes back - giving you insight into the disposition of the file.

File Intel

constructor(token: string, config: PangeaConfig): FileIntelService

Creates a new FileIntelService with the given Pangea API token and configuration.

required parameters

string

Pangea API token.

Configuration.

Response Object

FileIntelService
const config = new PangeaConfig({ domain: "pangea_domain" });
const fileIntel = new FileIntelService("pangea_token", config);

Reputation, from file path

filepathReputation(filepath: string, options: ReputationOptions): Promise<PangeaResponse<ReputationResult>>

Retrieve file reputation from a provider, using the file's hash.

required parameters

string

Path to the file to be looked up

An object of optional parameters. Parameters supported:

  • provider {String} - Use reputation data from this provider: "reversinglabs". Default provider defined by the configuration.
  • verbose {Boolean} - Echo the API parameters in the response. Default: verbose=false.
  • raw {Boolean} - Include raw data from this provider. Default: raw=false.

Response Object

Promise<PangeaResponse<ReputationResult>>
const response = await fileIntel.filepathReputation(
  "./myfile.exe",
  { provider: "reversinglabs" }
);

Reputation, from file paths

filepathReputationBulk(filepaths: string[], options: ReputationOptions): Promise<PangeaResponse<ReputationBulkResult>>

Retrieve file reputations from a provider, using the files' hashes.

required parameters

Array<string>

Paths to the files to be looked up

An object of optional parameters. Parameters supported:

  • provider {String} - Use reputation data from this provider: "reversinglabs". Default provider defined by the configuration.
  • verbose {Boolean} - Echo the API parameters in the response. Default: verbose=false.
  • raw {Boolean} - Include raw data from this provider. Default: raw=false.

Response Object

Promise<PangeaResponse<ReputationBulkResult>>
const response = await fileIntel.filepathReputationBulk(
  ["./myfile1.exe", "./myfile2.exe"],
  { provider: "reversinglabs" }
);

Reputation, from file hash

hashReputation(fileHash: string, hashType: string, options: ReputationOptions): Promise<PangeaResponse<ReputationResult>>

Retrieve hash-based file reputation from a provider, including an optional detailed report.

required parameters

string

Hash of the file to be looked up

string

Type of hash, can be "sha256", "sha" or "md5"

An object of optional parameters

Response Object

Promise<PangeaResponse<ReputationResult>>
const response = await fileIntel.hashReputation(
  "142b638c6a60b60c7f9928da4fb85a5a8e1422a9ffdc9ee49e17e56ccca9cf6e",
  "sha256",
  { provider: "reversinglabs" }
);

Reputation V2

hashReputationBulk(hashes: string[], hashType: string, options: ReputationOptions): Promise<PangeaResponse<ReputationBulkResult>>

Retrieve reputations for a list of file hashes, from a provider, including an optional detailed report.

required parameters

Array<string>

Hashes of each file to be looked up

string

Type of hash, can be "sha256", "sha" or "md5"

An object of optional parameters

  • provider - Provider of the reputation information. ("reversinglabs"). Default provider defined by the configuration.
  • verbose - Echo back the parameters of the API in the response. Default: verbose=false.
  • raw - Return additional details from the provider. Default: raw=false.

Response Object

Promise<PangeaResponse<ReputationBulkResult>>
const hashes = [
  "142b638c6a60b60c7f9928da4fb85a5a8e1422a9ffdc9ee49e17e56ccca9cf6e",
];

const response = await fileIntel.hashReputationBulk(
  hashes,
  "sha256",
  { provider: "reversinglabs" }
);

post(endpoint: string, data: object, options: PostOptions): Promise<PangeaResponse<R>>

POST request.

required parameters

string

Endpoint path.

object

Request body.

Additional options.

Response Object

Promise<PangeaResponse<R>>