## Statistics.

Statistics. — Statistics.

## Synopsis

                        flickcurl_stat;
                        flickcurl_view_stats;
    void                flickcurl_free_stat                 (flickcurl_stat *stat);
    void                flickcurl_free_stats                (flickcurl_stat **stats_object);
    void                flickcurl_free_view_stats           (flickcurl_view_stats *view_stats);
    int                 flickcurl_stats_getCSVFiles         (flickcurl *fc);
    flickcurl_stat **   flickcurl_stats_getCollectionDomains
                                                            (flickcurl *fc,
                                                             const char *date,
                                                             const char *collection_id,
                                                             int per_page,
                                                             int page);
    flickcurl_stat **   flickcurl_stats_getCollectionReferrers
                                                            (flickcurl *fc,
                                                             const char *date,
                                                             const char *domain,
                                                             const char *collection_id,
                                                             int per_page,
                                                             int page);
    int                 flickcurl_stats_getCollectionStats  (flickcurl *fc,
                                                             const char *date,
                                                             const char *collection_id);
    flickcurl_stat **   flickcurl_stats_getPhotoDomains     (flickcurl *fc,
                                                             const char *date,
                                                             const char *photo_id,
                                                             int per_page,
                                                             int page);
    flickcurl_stat **   flickcurl_stats_getPhotoReferrers   (flickcurl *fc,
                                                             const char *date,
                                                             const char *domain,
                                                             const char *photo_id,
                                                             int per_page,
                                                             int page);
    flickcurl_stat *    flickcurl_stats_getPhotoStats       (flickcurl *fc,
                                                             const char *date,
                                                             const char *photo_id);
    flickcurl_stat **   flickcurl_stats_getPhotosetDomains  (flickcurl *fc,
                                                             const char *date,
                                                             const char *photoset_id,
                                                             int per_page,
                                                             int page);
    flickcurl_stat **   flickcurl_stats_getPhotosetReferrers
                                                            (flickcurl *fc,
                                                             const char *date,
                                                             const char *domain,
                                                             const char *photoset_id,
                                                             int per_page,
                                                             int page);
    int                 flickcurl_stats_getPhotosetStats    (flickcurl *fc,
                                                             const char *date,
                                                             const char *photoset_id);
    flickcurl_stat **   flickcurl_stats_getPhotostreamDomains
                                                            (flickcurl *fc,
                                                             const char *date,
                                                             int per_page,
                                                             int page);
    flickcurl_stat **   flickcurl_stats_getPhotostreamReferrers
                                                            (flickcurl *fc,
                                                             const char *date,
                                                             const char *domain,
                                                             int per_page,
                                                             int page);
    int                 flickcurl_stats_getPhotostreamStats (flickcurl *fc,
                                                             const char *date);
    flickcurl_photo **  flickcurl_stats_getPopularPhotos    (flickcurl *fc,
                                                             const char *date,
                                                             const char *sort,
                                                             int per_page,
                                                             int page,
                                                             const char *extras);
    flickcurl_view_stats * flickcurl_stats_getTotalViews    (flickcurl *fc,
                                                             const char *date);

## Description

Statistics.

## Details

### flickcurl_stat

    typedef struct {
      int views;
      int comments;
      int favorites;
      char *name;
      char *url;
      char *searchterms;
    } flickcurl_stat;

Statistics object

int `views`; | number of views of item
int `comments`; | number of comments on item
int `favorites`; | number of item favorites
char *`name`; | name assocated with stat (e.g. domain name)
char *`url`; | URL associated with stat (e.g. referrer URL)
char *`searchterms`; | search term assocated with stat

### flickcurl_view_stats

    typedef struct {
      int total;
      int photos;
      int photostreams;
      int sets;
      int collections;
    } flickcurl_view_stats;

Total views statistics

int `total`; | total view
int `photos`; | number of photo views
int `photostreams`; | number of photostream views
int `sets`; | number of set views
int `collections`; | number of collection views

### flickcurl_free_stat ()

    void                flickcurl_free_stat                 (flickcurl_stat *stat);

Destructor for stat object

`stat` : | stat object

### flickcurl_free_stats ()

    void                flickcurl_free_stats                (flickcurl_stat **stats_object);

Destructor for array of stat objects

`stats_object` : | stat object array

### flickcurl_free_view_stats ()

    void                flickcurl_free_view_stats           (flickcurl_view_stats *view_stats);

Destructor for view stat object

`view_stats` : | view stat object

### flickcurl_stats_getCSVFiles ()

    int                 flickcurl_stats_getCSVFiles         (flickcurl *fc);

Returns a list of URLs for text files containing historic stats data (from November 26th 2007 to 1 June 2010) for the current user.

Not implemented since the files that this API call points to stop working after June 1 2010.

Implements flickr.stats.getCSVFiles (1.19)

Announced http://code.flickr.com/blog/2010/05/13/stats-api-redux/

`fc` : | flickcurl context
Returns : | always returns non-0 to signify failure

### flickcurl_stats_getCollectionDomains ()

    flickcurl_stat **   flickcurl_stats_getCollectionDomains
                                                            (flickcurl *fc,
                                                             const char *date,
                                                             const char *collection_id,
                                                             int per_page,
                                                             int page);

Get a list of referring domains for a collection

Implements flickr.stats.getCollectionDomains (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day.
`collection_id` : | The id of the collection to get stats for. If not provided, stats for all collections will be returned. (or NULL)
`per_page` : | Number of domains to return per page. If this argument is omitted, it defaults to 25. The maximum allowed value is 100. (or < 0)
`page` : | The page of results to return. If this argument is omitted, it defaults to 1. (or < 0)
Returns : | non-0 on failure

### flickcurl_stats_getCollectionReferrers ()

    flickcurl_stat **   flickcurl_stats_getCollectionReferrers
                                                            (flickcurl *fc,
                                                             const char *date,
                                                             const char *domain,
                                                             const char *collection_id,
                                                             int per_page,
                                                             int page);

Get a list of referrers from a given domain to a collection

Implements flickr.stats.getCollectionReferrers (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day.
`domain` : | The domain to return referrers for. This should be a hostname (eg: "flickr.com") with no protocol or pathname.
`collection_id` : | The id of the collection to get stats for. If not provided, stats for all collections will be returned. (or NULL)
`per_page` : | Number of referrers to return per page. If this argument is omitted, it defaults to 25. The maximum allowed value is 100. (or < 0)
`page` : | The page of results to return. If this argument is omitted, it defaults to 1. (or < 0)
Returns : | non-0 on failure

### flickcurl_stats_getCollectionStats ()

    int                 flickcurl_stats_getCollectionStats  (flickcurl *fc,
                                                             const char *date,
                                                             const char *collection_id);

Get the number of views on a collection for a given date.

Implements flickr.stats.getCollectionStats (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day.
`collection_id` : | The id of the collection to get stats for.
Returns : | views count or <0 on failure

### flickcurl_stats_getPhotoDomains ()

    flickcurl_stat **   flickcurl_stats_getPhotoDomains     (flickcurl *fc,
                                                             const char *date,
                                                             const char *photo_id,
                                                             int per_page,
                                                             int page);

Get a list of referring domains for a photo

Implements flickr.stats.getPhotoDomains (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day.
`photo_id` : | The id of the photo to get stats for. If not provided, stats for all photos will be returned. (or NULL)
`per_page` : | Number of domains to return per page. If this argument is omitted, it defaults to 25. The maximum allowed value is 100. (or < 0)
`page` : | The page of results to return. If this argument is omitted, it defaults to 1. (or < 0)
Returns : | non-0 on failure

### flickcurl_stats_getPhotoReferrers ()

    flickcurl_stat **   flickcurl_stats_getPhotoReferrers   (flickcurl *fc,
                                                             const char *date,
                                                             const char *domain,
                                                             const char *photo_id,
                                                             int per_page,
                                                             int page);

Get a list of referrers from a given domain to a photo

Implements flickr.stats.getPhotoReferrers (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day.
`domain` : | The domain to return referrers for. This should be a hostname (eg: "flickr.com") with no protocol or pathname.
`photo_id` : | The id of the photo to get stats for. If not provided, stats for all photos will be returned. (or NULL)
`per_page` : | Number of referrers to return per page. If this argument is omitted, it defaults to 25. The maximum allowed value is 100. (or < 0)
`page` : | The page of results to return. If this argument is omitted, it defaults to 1. (or < 0)
Returns : | non-0 on failure

### flickcurl_stats_getPhotoStats ()

    flickcurl_stat *    flickcurl_stats_getPhotoStats       (flickcurl *fc,
                                                             const char *date,
                                                             const char *photo_id);

Get the number of views, comments and favorites on a photo for a given date.

Implements flickr.stats.getPhotoStats (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day.
`photo_id` : | The id of the photo to get stats for.
Returns : | non-0 on failure

### flickcurl_stats_getPhotosetDomains ()

    flickcurl_stat **   flickcurl_stats_getPhotosetDomains  (flickcurl *fc,
                                                             const char *date,
                                                             const char *photoset_id,
                                                             int per_page,
                                                             int page);

Get a list of referring domains for a photoset

Implements flickr.stats.getPhotosetDomains (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day.
`photoset_id` : | The id of the photoset to get stats for. If not provided, stats for all sets will be returned. (or NULL)
`per_page` : | Number of domains to return per page. If this argument is omitted, it defaults to 25. The maximum allowed value is 100. (or < 0)
`page` : | The page of results to return. If this argument is omitted, it defaults to 1. (or < 0)
Returns : | non-0 on failure

### flickcurl_stats_getPhotosetReferrers ()

    flickcurl_stat **   flickcurl_stats_getPhotosetReferrers
                                                            (flickcurl *fc,
                                                             const char *date,
                                                             const char *domain,
                                                             const char *photoset_id,
                                                             int per_page,
                                                             int page);

Get a list of referrers from a given domain to a photoset

Implements flickr.stats.getPhotosetReferrers (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day.
`domain` : | The domain to return referrers for. This should be a hostname (eg: "flickr.com") with no protocol or pathname.
`photoset_id` : | The id of the photoset to get stats for. If not provided, stats for all sets will be returned. (or NULL)
`per_page` : | Number of referrers to return per page. If this argument is omitted, it defaults to 25. The maximum allowed value is 100. (or < 0)
`page` : | The page of results to return. If this argument is omitted, it defaults to 1. (or < 0)
Returns : | non-0 on failure

### flickcurl_stats_getPhotosetStats ()

    int                 flickcurl_stats_getPhotosetStats    (flickcurl *fc,
                                                             const char *date,
                                                             const char *photoset_id);

Get the number of views on a photoset for a given date.

Implements flickr.stats.getPhotosetStats (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day.
`photoset_id` : | The id of the photoset to get stats for.
Returns : | number of views or <0 on failure

### flickcurl_stats_getPhotostreamDomains ()

    flickcurl_stat **   flickcurl_stats_getPhotostreamDomains
                                                            (flickcurl *fc,
                                                             const char *date,
                                                             int per_page,
                                                             int page);

Get a list of referring domains for a photostream

Implements flickr.stats.getPhotostreamDomains (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day.
`per_page` : | Number of domains to return per page. If this argument is omitted, it defaults to 25. The maximum allowed value is 100 (or < 0)
`page` : | The page of results to return. If this argument is omitted, it defaults to 1. (or < 0)
Returns : | non-0 on failure

### flickcurl_stats_getPhotostreamReferrers ()

    flickcurl_stat **   flickcurl_stats_getPhotostreamReferrers
                                                            (flickcurl *fc,
                                                             const char *date,
                                                             const char *domain,
                                                             int per_page,
                                                             int page);

Get a list of referrers from a given domain to a user's photostream

Implements flickr.stats.getPhotostreamReferrers (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day.
`domain` : | The domain to return referrers for. This should be a hostname (eg: "flickr.com") with no protocol or pathname.
`per_page` : | Number of referrers to return per page. If this argument is omitted, it defaults to 25. The maximum allowed value is 100. (or < 0)
`page` : | The page of results to return. If this argument is omitted, it defaults to 1. (or < 0)
Returns : | non-0 on failure

### flickcurl_stats_getPhotostreamStats ()

    int                 flickcurl_stats_getPhotostreamStats (flickcurl *fc,
                                                             const char *date);

Get the number of views on a user's photostream for a given date.

Implements flickr.stats.getPhotostreamStats (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day.
Returns : | number of views or <0 on failure

### flickcurl_stats_getPopularPhotos ()

    flickcurl_photo **  flickcurl_stats_getPopularPhotos    (flickcurl *fc,
                                                             const char *date,
                                                             const char *sort,
                                                             int per_page,
                                                             int page,
                                                             const char *extras);

Get stats for popular photos

Implements flickr.stats.getPopularPhotos (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day. If no date is provided, all time view counts will be returned. (or NULL)
`sort` : | The order in which to sort returned photos. Defaults to views. The possible values are views, comments and favorites. Other sort options are available through search. (or NULL)
`per_page` : | Number of referrers to return per page. If this argument is omitted, it defaults to 25. The maximum allowed value is 100. (or < 0)
`page` : | The page of results to return. If this argument is omitted, it defaults to 1. (or < 0)
`extras` : | A comma-delimited list of extra information to fetch for each returned record. Currently supported fields are: `description`, `license`, `date_upload`, `date_taken`, `owner_name`, `icon_server`, `original_format`, `last_update`, `geo`, `tags`, `machine_tags`, `o_dims`, `views`, `media`, `path_alias`, `url_sq`, `url_t`, `url_s`, `url_m`, `url_o` (or NULL)
Returns : | non-0 on failure

### flickcurl_stats_getTotalViews ()

    flickcurl_view_stats * flickcurl_stats_getTotalViews    (flickcurl *fc,
                                                             const char *date);

Get the overall view counts for an account

Implements flickr.stats.getTotalViews (1.17)

Announced 2010-03-03 http://code.flickr.com/blog/2010/03/03/flickr-stats-api/

`fc` : | flickcurl context
`date` : | Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day. If no date is provided, all time view counts will be returned. (or NULL)
Returns : | view count or <0 on failure