Fork me on GitHub


Build status

Enables cross-domain requests to any JSON API.

Very useful for mashup sites - since API calls can be done client-side, no server code is needed. Note that exposing API secret keys in client code is discouraged.


For APIs that support JSONP. Example using jQuery.getJSON():

Easier: Cross-domain AJAX

For browsers and APIs that support CORS. Example using fetch():

Easiest: jQuery Plugin

Wrapper function of jQuery.ajax(), which detects browser support and picks the best available transport:

  1. CORS directly
  2. CORS via proxy
  3. JSONP directly
  4. JSONP via proxy

In addition to the options available for jQuery.ajax(), the plugin adds two additional options: corsSupport and jsonpSupport.


bower install jsonproxy, or download directly. Requires jQuery 1.5+ and URI.js.

AMD Setup

Once the plugin is installed, it's easy to include it from a frontend module loader like RequireJS:

Check out the RequireJS jQuery guide for more information.

Disclaimer is rate-limited. Reach out to if interested in higher throughput.


Unfortunately, detection of response errors with JSONP is difficult, at best. jQuery's JSONP implementation won't call an error callback unless an explicit timeout is specified (which the plugin takes care of) - see here for more info and options.

CORS, however, is just normal AJAX! There is also a security advantage, in that it's not possible for a malicious service (including this one) to run arbirtrary JavaScript on your page.