The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.


WWW::Socrata - The great new WWW::Socrata!


Version 0.02


    use WWW::Socrata;
    my %options = (
                base_url =>  "",
    my $socrata = new WWW::Socrata(\%options);
    my $rh_result = $socrata->get("/api/views/74cu-ncm4/rows.json", {});


This library provides a simple wrapper for accessing some of the features of the Socrata Open Data API from PHP. Currently it only supports HTTP GET operations, but in the future it will support other methods as well.

The library is very simple. To access the Socrata API, you first instantiate a "Socrata" object, passing in the API base URL for the data site you wish to access. The Base URL is always the URL for the root of the datasite, with "/api" added to the path (ex: or Then you can use its included methods to make simple API calls:

This library provides an interface to the SODA Publisher API. If you're new to all this, you may want to brush up on the getting started guide.

If you're curious about how things work under the hood, you can also browse the API documentation directly.


Additional options when creating the new Socrata object

   use WWW::Socrata;
   my %options = (
                base_url  =>  "",
                app_token => "", #optional
                username  => "", #optional for authenticated requests
                password  => "", #optional for authenticated requests
    my $socrata = new WWW::Socrata(\%options);

You may also add additional criteria on the get function, for searching or retrieving subsets of the data

   my $rh_result = $socrata->get("/api/views/74cu-ncm4/rows.json",
                                "length" =>60,



Benjamin Marcus, <ben at>


Please report any bugs or feature requests to bug-www-socrata at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc WWW::Socrata

You can also look for information at:



Copyright 2012 Benjamin Marcus.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.