Skip to content

ntoporcov/dym

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9a92785 · Jan 14, 2020

History

6 Commits
Jan 10, 2020
Jan 10, 2020
Jan 14, 2020
Jan 11, 2020
Jan 11, 2020
Jan 11, 2020

Repository files navigation

DYM – Did You Mean...

What is this?

I needed a simple way to fix user mispelling on one of my apps and I thought it would be neat if I could leverage suggestions from Google, so I created this open API. It could not be simpler now to get suggestions on mispellings.

Google blocks their suggestion API from cross origin calls, so DYM allows you to easily get a suggestion array from anywhere.

How to use the API

  • DYM only accepts GET Requests.
  • Header Accept must be set to application/json
  • Query must be formatted for URL.
  • Request must be sent to http://dym.show/QUERY

Javascript Example 

    const request = new XMLHttpRequest();
    request.open('GET', 'http://dym.show/'+QUERY, true);
    request.setRequestHeader('Accept', 'application/json');

    request.onreadystatechange = function() {
        if (request.readyState === 4) {
            const response = JSON.parse(request.responseText);
            // do stuff here
        }
    };

    request.send();