Album Table

Problem

What’s the schema for the album table?

Solution

The album table holds all of the photo albums that users have created in the Facebook Photos application. Its fields are listed in Table 8-2. Queries to this table will only return data the current user is allowed to see (in other words, you can’t request albums that this user isn’t allowed to see). More information about this table, including an up-to-date listing of fields, can be found at http://wiki.developers.facebook.com/index.php/Album_(FQL).

Table 8-2. album table fields

Name

Type

Index

Description

aid

int

Album ID.

cover_pid

int

pid (photo ID) of the photo that has been set as the cover of the album.

owner

int

uid (user ID) of the owner of this album (i.e., the user who created it).

name

string

 

Name of the album.

created

string

 

Creation date of the album.

modified

string

 

Date that the album was last updated, in epoch seconds (see Formatting Relative Time for an explanation of epoch seconds).

description

string

 

Description entered by the album’s owner.

location

string

 

Location entered by the album’s owner (e.g., Toronto, The Moon).

size

int

 

The number of photos in the album.

link

string

 

URL to the album (i.e., the actual Facebook URL for this album).

Note that only the fields marked as “Index” in this table can be used in an FQL query’s WHERE clause, but any of the fields can appear in the SELECT.

Discussion

If you’d rather use the API to access albums, try the Photos.getAlbums() method.

Get Facebook Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.