Discussions

 View Only

Genderize Demo ~ Simple JSON API Integration

  • 1.  Genderize Demo ~ Simple JSON API Integration

    Posted 11-16-2018 08:25
    I was recently at a PyData meetup where the presenter used a service called genderize.io to guess the gender of a person given the first name. The API took a first name as a parameter and returned a JSON representation of the gender ("male" or "female") and a probability for the match. The API is so simple I thought I would implement it through QuickBase as it represents an excellent demo of how to integrate with QuickBase APIs that return JSON. Feel free to add your own record:

    Gender Guesser ~ Add New Record
    https://haversineconsulting.quickbase.com/db/bn6iunh4q?a=nwr">https://haversineconsulting.quickbase.com/db/bn6iunh4q?a=nwr">https://haversineconsulting.quickbase.com/db/bn6iunh4q?a=nwr

    Pastie Database
    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=689">https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=689">https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=689

    Notes:

    (1) Fields [Gender] and [Probability] on the form are set to readonly to prevent a human from directly editing the value thus insuring the results always come from the genderize.io API.

    (2) This basic script can easily be extended to automatically call the genderize.io API when the [Name] field is changed thus avoiding the button.

    (3) Additionally, a simple modification of the script can be used to bulk update a [Name] field in a table assuming you limit yourself to 1000 API calls per day (the free threshold for the service):

    Genderize API
    https://genderize.io/">https://genderize.io/">https://genderize.io/