Skip to content

UN-OCHA/rw-api-to-csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReliefWeb API to CSV

Install locally

npm i
npm start

You will now have a file data.csv containing the data.

Edit on GitGub

  • Edit index.mjs
  • Make changes
  • Click on Commit changes...
  • Specify a new branch

Filters

You can change the used filters at the top of the file.

Check API documentation for an overview.

let filters = [
    {
        field: 'date.created',
        value: {
            from: '2024-01-01T00:00:00+00:00',
            to: '2024-12-31T23:59:59+00:00'
        }
    }
];

Customize

To change the fields to fetch from ReliefWeb API, have a look at getData(), it support the fields defined in the documentation.

Make sure to also define the output of the field in writeCsv(), the code depends on the type of the field.

  • Simple property (ex. Title): fields.title
  • Nested property (ex. Primary country): fields.primary_country.iso3
  • Array of objects (ex. Country): (row) => row.fields.country.map((x) => x.iso3).join(',')

GDrive

data.csv is uploaded to https://drive.google.com/drive/folders/0B3AvU8yMBJnEWk9EQmR1OXVIdVU

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published