Skip to content

An example of using Python to query the eCX API and paginate the results

License

Notifications You must be signed in to change notification settings

APWG/ecx-api-pagination-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Paginate the eCX API

Version 1.0.0

A simple Python example using the Requests module to interact with the eCX API to query for the latest phish data. Because the eCX API uses the HAL+JSON spec in the output users are able to iterate through pages of results matching their query parameters.

CSV Output

By default eCX outputs all data in JSON using the HAL+JSON spec, which allows consumers of the data to control all pagination thoughout the result set.

However, the eCX API fully supports CSV output using the container parameter set to csv.

Example:

https://api.ecrimex.net/phish?container=csv

Note that the default JSON object contains nested key value pairs that will not flatten into CSV, so the only values returned when CSV is desired are: id, brand, date_discovered, URL, confidence_level, and modified.

This example goes a little further with CSV output, and does not use the container=csv parameter, instead it demonstrates how to use Python to convert the output to csv on the fly. Note that there will be data loss in the arrays containing possible multiple values

Developed By...

Alan Fajardo for the APWG, alan.fajardo916@gmail.com

About

An example of using Python to query the eCX API and paginate the results

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages