How to make an API call using meteor

You are defining your checkTwitter Meteor.method inside a client-scoped block. Because you cannot call cross domain from the client (unless using jsonp), you have to put this block in a Meteor.isServer block.

As an aside, per the documentation, the client side Meteor.method of your checkTwitter function is merely a stub of a server-side method. You’ll want to check out the docs for a full explanation of how server-side and client-side Meteor.methods work together.

Here is a working example of the http call:

if (Meteor.isServer) {
        checkTwitter: function () {
            return"GET", "");

//invoke the server method
if (Meteor.isClient) {"checkTwitter", function(error, results) {
        console.log(results.content); // should be a JSON object

Leave a Comment