English | Site Directory

FeedBurner API

Feed Management API Quick Tour

This walking tour through several code submissions and responses shows you calls that create, modify, and finally (a bit cruelly, perhaps?) delete a feed from a FeedBurner user account. The tour uses a UNIX command line utility called "curl" to make the actual calls to our API, and also employs a convenient third-party service, URLEncoder, to encode URLs for submission.

First, you need to create a user account at FeedBurner. For the purposes of these examples, we'll use the account with an id of "apitest" and a password of "swoops".

List Feeds

Now, let's check to see if the account has any feeds:

    $ curl http://api.feedburner.com/management/1.0/FindFeeds

    <?xml version="1.0" encoding="utf-8" ?>
    <rsp stat="fail">
        <err code="1" msg="Invalid User" />
    </rsp>

Well, of course that fails ... we didn't specify the account anywhere! There are two possible ways to pass in the account information: either as parameters of the url, or as an HTTP Basic authorization header.

Here's an example using parameters:

    $ curl "http://api.feedburner.com/management/1.0/FindFeeds?user=apitest&password=swoops"

    <?xml version="1.0" encoding="UTF-8"?>
    <rsp stat="ok">
        <feeds />

    </rsp>

Here's an example using HTTP Basic authentication:

    $ curl -u apitest:swoops http://api.feedburner.com/management/1.0/FindFeeds

    <?xml version="1.0" encoding="UTF-8"?>
    <rsp stat="ok">
        <feeds />

    </rsp>

We'll use the latter method for the rest of the examples in this document.

Create Feed

So, as expected, we don't have any feeds yet. Let's add one! We're going to create a text file that has our feed definition in it, and then reference that file with our command line tool.

    <feed uri="apitest/firstFeed" title="My First Feed">

         <source  url="http://www.burningdoor.com/test/index.rdf"/>
         <services>
             <service class="ItemStats" />
             <service class="SmartFeed" />
         </services>
    </feed>

Unfortunately, for our examples, we have to url encode that parameter, so it's going to look a little nasty. You can use a quick and dirty utility at http://www.asifproductions.com/urlencode.html to get the encoded parameter.

    $ curl -u apitest:swoops -d "feed=%3Cfeed+uri%3D%22apitest%2FfirstFeed%22+title%3D%22My+First+
    Feed%22%3E%0D%0A+++++%3Csource+url%3D%22http%3A%2F%2Fwww.burningdoor.com%2Ftest%2Findex.rdf
    %22%2F%3E%0D%0A+++++%3Cservices%3E%0D%0A+++++++++%3Cservice+class%3D%22ItemStats%22+
    %2F%3E%0D%0A+++++++++%3Cservice+class%3D%22SmartFeed%22+%2F%3E%0D%0A+++++
    %3C%2Fservices%3E%0D%0A%3C%2Ffeed%3E" http://api.feedburner.com/management/1.0/AddFeed

    <?xml version="1.0" encoding="UTF-8"?>
    <rsp stat="ok">
        <feed id="98210" uri="apitest/firstFeed" title="My First Feed" />

    </rsp>

That's our feed. Let's confirm it was added by getting all of our feeds again.

    $ curl -u apitest:swoops http://api.feedburner.com/management/1.0/FindFeeds

    <?xml version="1.0" encoding="UTF-8"?>
    <rsp stat="ok">
        <feeds>

            <feed id="98210" uri="apitest/firstFeed" title="My First Feed" />
        </feeds>
    </rsp>

Now let's get the details for that feed.

    $ curl -u apitest:swoops "http://api.feedburner.com/management/1.0/GetFeed?id=98200"

    <?xml version="1.0" encoding="utf-8" ?>

    <rsp stat="fail">
                    <err code="5" msg="Feed not found" />
    </rsp>

Whoops ... we mistyped the id. We can only access our own feeds. Let's try that again.

    $ curl -u apitest:swoops "http://api.feedburner.com/management/1.0/GetFeed?id=98210"

    <?xml version="1.0" encoding="UTF-8"?>

    <rsp stat="ok">
        <feed id="98210" uri="apitest/firstFeed" title="My First Feed">
            <source url="http://www.burningdoor.com/test/index.rdf" />
            <services>
                <service class="SmartFeed" />
                <service class="ItemStats" />

            </services>
        </feed>
    </rsp>

Apply Services

Great! That's our feed. Now let's add the Browser-Friendly service. We want to modify the feed:

    <feed uri="apitest/firstFeed">
     <source url="http://www.burningdoor.com/test/index.rdf"/>
     <services>
         <service class="ItemStats" />
         <service class="SmartFeed" />
         <service class="BrowserFriendly">

             <param name="style">new</param>
         </service>
     </services>
    </feed>

So, again running that through the encode, we get this:

    $ curl -u apitest:swoops -d "feed=%3Cfeed+uri%3D%22apitest%2FfirstFeed%22%3E%0D%0A+++++%3Csource+
    url%3D%22http%3A%2F%2Fwww.burningdoor.com%2Ftest%2Findex.rdf%22%2F%3E%0D%0A+++++%3Cservices%3E%0D%0A
    +++++++++%3Cservice+class%3D%22ItemStats%22+%2F%3E%0D%0A+++++++++%3Cservice+class%3D%22SmartFeed%22+
    %2F%3E%0D%0A+++++++++%3Cservice+class%3D%22BrowserFriendly%22%3E%0D%0A+++++++++%09%3Cparam+
    name%3D%22style%22%3Enew%3C%2Fparam%3E%0D%0A+++++++++%3C%2Fservice%3E%0D%0A+++++
    %3C%2Fservices%3E%0D%0A%3C%2Ffeed%3E" http://api.feedburner.com/management/1.0/ModifyFeed

    <?xml version="1.0" encoding="UTF-8"?>
    <rsp stat="ok">
        <feed id="98210" uri="apitest/firstFeed" title="My First Feed" />
    </rsp>

Confirm with another GetFeed call:

    $ curl -u apitest:swoops "http://api.feedburner.com/management/1.0/GetFeed?id=98210"

    <?xml version="1.0" encoding="UTF-8"?>
    <rsp stat="ok">
        <feed id="98210" uri="apitest/firstFeed" title="My First Feed">
            <source url="http://www.burningdoor.com/test/index.rdf" />
            <services>

                <service class="SmartFeed" />
                <service class="BrowserFriendly" />
                <service class="ItemStats" />
            </services>
        </feed>
    </rsp>

Delete Feed

We're done with this feed. Delete it.

    $ curl -u apitest:swoops -d "uri=apitest/firstFeed" 
		http://api.feedburner.com/management/1.0/DeleteFeed

No response means success. Let's double-check:

    $ curl -u apitest:swoops http://api.feedburner.com/management/1.0/FindFeeds

    <?xml version="1.0" encoding="UTF-8"?>

    <rsp stat="ok">
        <feeds />
    </rsp>

So concludes this tour. Continue to the Feed Management API reference to get the details you need to start authoring your own applications using this API.