Propublica API Data in Drupal using External Entities

Propublica has an API for data about USA Congress. To use the API, sign up for an API key on that page.

External Entities provides a UI for configuring the API endpoint and mapping to an entity with fields to store the data.

*I think this module has a lot of potential, but at the moment it is still in development and there are a few concerns such as lack of tests and missing features like a way to list the entities. I encourage others to check it out and get involved in development if they'd like to use this method over alternatives like writing a migration.

 

Create an External Entity

  1. Go to Structure > External entity types.
  2. Create a new external entity called Representative.
    • Set up storage info w/ api endpoint.
    • Set up mapping w/ path to id, title
    • Configure caching
  3. Configure fields, map to values
  4. View content at /ENTITY_TYPE/ID

 

Tags