Facebook Data Model

Connection String Options

  1. Aggregate Format
  2. Authenticate As Page
  3. Auto Cache
  4. Cache Connection
  5. Cache Driver
  6. Cache Location
  7. Cache Metadata
  8. Cache Query Result
  9. Cache Tolerance
  10. Callback URL
  11. Connect On Open
  12. Firewall Password
  13. Firewall Port
  14. Firewall Server
  15. Firewall Type
  16. Firewall User
  17. Initiate OAuth
  18. Location
  19. Logfile
  20. Max Log File Size
  21. OAuth Access Token
  22. OAuth Client Id
  23. OAuth Client Secret
  24. OAuth Settings Location
  25. Offline
  26. Other
  27. Pagesize
  28. Pool Idle Timeout
  29. Pool Max Size
  30. Pool Wait Time
  31. Proxy Auth Scheme
  32. Proxy Auto Detect
  33. Proxy Password
  34. Proxy Port
  35. Proxy Server
  36. Proxy SSL Type
  37. Proxy User
  38. Pseudo Columns
  39. Readonly
  40. RTK
  41. Search Terms
  42. SSL Server Cert
  43. Support Enhanced SQL
  44. Tables
  45. Target
  46. Timeout
  47. Use Connection Pooling
  48. Verbosity
  49. Version
  50. Views

Aggregate Format

Data Type

string

Default Value

"JSON"

Remarks

The format aggregate or collection columns should return in.

 

Authenticate As Page

Data Type

string

Default Value

""

Remarks

The Id of a page to retrieve data from. The page must be managed by the authenticated user; you can obtain the Ids for all such pages by querying the Pages view.

 

Auto Cache

Data Type

bool

Default Value

false

Remarks

When AutoCache is set, the driver automatically maintains a cache of your table's data in the database of your choice. By default, the driver incrementally updates the cache, retrieving only changes since the last SELECT query was run if the length of time since the last run has exceeded the CacheTolerance. After the cache is updated, the query is executed against the cached data. With CacheQueryResult set, the driver updates the cache when you execute a SELECT query and returns the live results from the Facebook data.

 

Explicitly Caching SELECT Results

 

CacheQueryResult is a way to query Facebook in real time while maintaining a cache for offline use. Set CacheQueryResult to update the cache whenever you execute a SELECT statement. When you execute a SELECT statement with AutoCache and CacheQueryResult set, the driver executes the query to the remote data and caches the results; rows that already exist are overwritten. That is, SELECT statements are used to create and refresh the cache, not to query it. Data manipulation commands are executed to the remote data as well.

To query the cached data, set the Offline property. If you need to query the cached data in an online connection, you can append #CACHE to the table name. For example:

SELECT * FROM [Statuses#CACHE]

 

 

Setting the Caching Database

 

When AutoCache is set, the driver caches to a simple, file-based cache. You can configure its location or cache to a different database with the following properties:

 

 

See Also

 

 

  • CacheTolerance: Control the tolerance for stale data in the cache.
  • CacheQueryResult: Insert or update each row returned into the corresponding table in the cache.
  • Caching: Best Practices: This section provides more examples of using AutoCache with Offline, as well as information on determining a caching strategy.

    When this property is set, the driver builds a temporary, in-memory dataset that caches the results of the queries you execute. Result sets for subsequent queries are extracted from this dataset, if possible.

    This property is useful in BI, analytics, and other tools that generate queries for you. In these tools, explicit cache queries with the #CACHE syntax may not be an option.

  • CacheMetadata: This property reduces the amount of metadata that crosses the network by persisting table schemas retrieved from the Facebook metadata. Metadata then needs to be retrieved only once instead of every connection.
  • REPLICATE Statements: When you execute a SELECT statement with AutoCache set, the driver internally calls the REPLICATE statement. The REPLICATE statement enables incremental updates instead of first dropping the cached table.
  • CACHE Statements: You can use the CACHE statement to persist any SELECT query, as well as manage the cache; for example, refreshing schemas.

 

 

 

Cache Connection

Data Type

string

Default Value

""

Remarks

The cache database is determined based on the CacheDriver and CacheConnection properties. Both properies are required to use the cache database. Examples of common cache database settings can be found below. For more information on setting the caching database's driver, refer to CacheDriver.

The connection string specified in the CacheConnection property is passed directly to the underlying CacheDriver. Consult the documentation for the specific JDBC driver for more information on the available properties. Make sure to include the JDBC driver in your application's classpath.

 

Derby and Java DB

 

The driver simplifies caching to Derby, only requiring you to set the CacheLocation property to make a basic connection.

Alternatively, you can configure the connection to Derby manually using CacheProvider and CacheConnection. Below is the Derby JDBC URL syntax:

jdbc:derby:[subsubprotocol:][databaseName][;attribute=value[;attribute=value] ... ]
For example, to cache to an in-memory database, use the following:
jdbc:derby:memory

 

 

SQLite

 

To cache to SQLite, you can use the SQLite JDBC driver. Below is the syntax of the JDBC URL:

jdbc:sqlite:dataSource
  • Data Source: The path to an SQLite database file. Or, use a value of :memory to cache in memory.

 

 

MySQL

 

The installation includes the CData JDBC Driver for MySQL. Below is an example JDBC URL:

jdbc:mysql:User=root;Password=root;Server=localhost;Port=3306;Database=cache
Below are typical connection properties:

 

 

  • Server: The IP address or domain name of the server you want to connect to.
  • Port: The port that the server is running on.
  • User: The username provided for authentication to the database.
  • Password: The password provided for authentication to the database.
  • Database: The name of the database.
SQL Server

 

The JDBC URL for the Microsoft JDBC Driver for SQL Server has the following syntax:

jdbc:sqlserver://[serverName[\instance][:port]][;database=databaseName][;property=value[;property=value] ... ]
For example:
jdbc:sqlserver://localhost\sqlexpress:1433;integratedSecurity=true
Below are typical SQL Server connection properties:
  • Server: The name or network address of the computer running SQL Server. To connect to a named instance instead of the default instance, this property can be used to specify the host name and the instance, separated by a backslash.
  • Port: The port SQL Server is running on.
  • Database: The name of the SQL Server database.
  • Integrated Security: Set this option to true to use the current Windows account for authentication. Set this option to false if you are setting the User and Password in the connection.

    To use integrated security, you will also need to add sqljdbc_auth.dll to a folder on the Windows system path. This file is located in the auth subfolder of the Microsoft JDBC Driver for SQL Server installation. The bitness of the assembly must match the bitness of your JVM.

  • User: The username provided for authentication with SQL Server. Only needed if you are not using integrated security.
  • Password: The password provided for authentication with SQL Server. Only needed if you are not using integrated security.
Oracle

 

Below is the conventional JDBC URL syntax for the Oracle JDBC Thin driver:

jdbc:oracle:thin:[userId/password]@[//]host[[:port][:sid]]
For example:
jdbc:oracle:thin:scott/tiger@myhost:1521:orcl
Below are typical connection properties:
  • Data Source: The connect descriptor that identifies the Oracle database. This can be a TNS connect descriptor, an Oracle Net Services name that resolves to a connect descriptor, or, after version 11g, an Easy Connect naming (the host name of the Oracle server with an optional port and service name).

  • Password: The password provided for authentication with the Oracle database.
  • User Id: The user Id provided for authentication with the Oracle database.
PostgreSQL

 

Below is the JDBC URL syntax for the official PostgreSQL JDBC driver:

jdbc:postgresql:[//[host[:port]]/]database[[?option=value][[&option=value][&option=value] ... ]]
For example, the following connection string connects to a database on the default host (localhost) and port (5432):
jdbc:postgresql:postgres
Below are typical connection properties:
  • Host: The address of the server hosting the PostgreSQL database.
  • Port: The port used to connect to the server hosting the PostgreSQL database.
  • Database: The name of the database.
  • Username: The user Id provided for authentication with the PostgreSQL database. You can specify this in the JDBC URL with the "user" parameter.
  • Password: The password provided for authentication with the PostgreSQL database.

 

 

Cache Driver

Data Type

string

Default Value

""

Remarks

You can cache to any database for which you have a JDBC driver, including CData JDBC drivers.

The cache database is determined based on the CacheDriver and CacheConnection properties. The CacheDriver is the name of the JDBC driver class that you would like to use to cache data.

Note that you must also add the CacheDriver JAR to the classpath.

The following examples show how to cache to several major databases. Refer to CacheConnection for more information on the JDBC URL syntax and typical connection properties.

Derby and Java DB

 

 

The driver simplifies Derby configuration. Java DB is the Oracle distribution of Derby. The JAR is shipped in the JDK. You can find the JAR, derby.jar, in the db subfolder of the JDK installation. In most caching scenarios, you need to specify only the following, after adding derby.jar to the classpath.

jdbc:facebook:CacheLocation='c:/Temp/cachedir';InitiateOAuth=GETANDREFRESH;
To customize the Derby JDBC URL, use CacheDriver and CacheConnection. For example, to cache to an in-memory database, use a JDBC URL like the following:
jdbc:facebook:CacheDriver=org.apache.derby.jdbc.EmbeddedDriver;CacheConnection='jdbc:derby:memory';InitiateOAuth=GETANDREFRESH;
SQLite

 

Below is a JDBC URL for the SQLite JDBC driver:

jdbc:facebook:CacheDriver=org.sqlite.JDBC;CacheConnection='jdbc:sqlite:C:/Temp/sqlite.db';InitiateOAuth=GETANDREFRESH;
MySQL

 

Below is a JDBC URL for the included CData JDBC Driver for MySQL:

jdbc:facebook:Cache Driver=cdata.jdbc.mysql.MySQLDriver;Cache Connection='jdbc:mysql:Server=localhost;Port=3306;Database=cache;User=root;Password=123456';InitiateOAuth=GETANDREFRESH;
The CData JDBC Driver for MySQL is located in the lib subfolder of the CData JDBC Driver for Facebook 2017 installation directory.
SQL Server

 

The following JDBC URL uses the Microsoft JDBC Driver for SQL Server:

jdbc:facebook:Cache Driver=com.microsoft.sqlserver.jdbc.SQLServerDriver;Cache Connection='jdbc:sqlserver://localhost\sqlexpress:7437;user=sa;password=123456;databaseName=Cache';InitiateOAuth=GETANDREFRESH;
Oracle

 

Below is a JDBC URL for the Oracle Thin Client:

jdbc:facebook:Cache Driver=oracle.jdbc.driver.OracleDriver;CacheConnection='jdbc:oracle:thin:scott/tiger@localhost:1521:orcldb';InitiateOAuth=GETANDREFRESH;
PostgreSQL

 

The following JDBC URL uses the official PostgreSQL JDBC driver:

jdbc:facebook:CacheDriver=org.postgresql.Driver;CacheConnection='jdbc:postgresql://localhost:5433/postgres?user=postgres&password=admin';InitiateOAuth=GETANDREFRESH;

 

 

Cache Location

Data Type

string

Default Value

""

Remarks

The CacheLocation is a simple, file-based cache. The driver uses Java DB, Oracle's distribution of the Derby database. To cache to Java DB, you will need to add the Java DB JAR to the classpath. The JAR, derby.jar, is shipped in the JDK and located in the db subfolder of the JDK installation.

CacheLocation defaults to the directory specified by the Location setting.

See Also

 

 

  • AutoCache: Set this to implicitly create and maintain a cache for later offline use.
  • CacheMetadata: Set this to persist the Facebook catalog in CacheLocation.

 

 

Cache Metadata

Data Type

bool

Default Value

false

Remarks

As you execute queries with this property set, table metadata in the Facebook catalog are cached to the file store specified by CacheLocation if set or the user's home directory otherwise. A table's metadata will be retrieved only once, when the table is queried for the first time.

When to Use CacheMetadata

 

The driver automatically persists metadata in memory for up to two hours when you first discover the metadata for a table or view and therefore, CacheMetadata is generally not required. CacheMetadata becomes useful when metadata operations are expensive such as when you are working with large amounts of metadata or when you have many short-lived connections.

When Not to Use CacheMetadata

 

 

  • When you are working with volatile metadata: Metadata for a table is only retrieved the first time the connection to the table is made. To pick up new, changed, or deleted columns, you would need to delete and rebuild the metadata cache. Therefore, it is best to rely on the in-memory caching for cases where metdata will change often.
  • When you are caching to a database: CacheMetadata can only be used with CacheLocation. If you are caching to another database with the CacheDriver and CacheConnection properties, use AutoCache to cache implicitly. Or, use REPLICATE Statements or CACHE Statements to cache explicitly.

 

 

Cache Query Result

Data Type

bool

Default Value

false

Remarks

When CacheQueryResult and AutoCache are set, the rows returned from a SELECT query are cached in the cache database. The driver handles caching in a streaming fashion with each row being processed into the cache database from the original result set as you read the row from the returned ResultSet object. This ensures that the live data is not queried twice. Note that any rows you do not read from the returned ResultSet will not be updated in the cache.

 

Cache Tolerance

Data Type

string

Default Value

"600"

Remarks

The tolerance for stale data in the cache specified in seconds. This only applies when AutoCache is used. The driver will check with the data source for newer records after the tolerance interval has expired. Otherwise it will return the data directly from the cache.

 

Callback URL

Data Type

string

Default Value

""

Remarks

This value is the URL that Facebook redirects to during the authentication process.

 

Connect On Open

Data Type

bool

Default Value

false

Remarks

When set to 'true', a connection will be made to Facebook when the connection is opened. This property enables the 'Test Connection' feature available in various database tools.

This feature acts as a NOOP command as it is used to verify a connection can be made to Facebook and nothing from this initial connection is maintained.

Setting this property to 'false' may provide performance improvements (depending upon the number of times a connection is opened).

 

Firewall Password

Data Type

string

Default Value

""

Remarks

This property is passed to the proxy specified by FirewallServer and FirewallPort, following the authentication method specified by FirewallType.

 

Firewall Port

Data Type

string

Default Value

""

Remarks

This specifies the TCP port for a proxy allowing traversal of a firewall. Use FirewallServer to specify the name or IP address. Specify the protocol with FirewallType.

 

Firewall Server

Data Type

string

Default Value

""

Remarks

This property specifies the IP address, DNS name, or host name of a proxy allowing traversal of a firewall. The protocol is specified by FirewallType: Use FirewallServer with this property to connect through SOCKS or do tunneling. Use ProxyServer to connect to an HTTP proxy.

Note that the driver uses the system proxy by default. To use a different proxy, set ProxyAutoDetect to false.

 

Firewall Type

Data Type

string

Default Value

"NONE"

Remarks

This property specifies the protocol that the driver will use to tunnel traffic through the FirewallServer proxy. Note that by default the driver connects to the system proxy; to disable this behavior and connect to one of the following proxy types, set ProxyAutoDetect to false.

 

   
Type Default Port Description
TUNNEL 80 When this is set, the driver opens a connection to Facebook and traffic flows back and forth through the proxy.
SOCKS4 1080 When this is set, the driver sends data through the SOCKS 4 proxy specified by FirewallServer and FirewallPort and passes the FirewallUser value to the proxy, which determines if the connection request should be granted.
SOCKS5 1080 When this is set, the driver sends data through the SOCKS 5 proxy specified by FirewallServer and FirewallPort. If your proxy requires authentication, set FirewallUser and FirewallPassword to credentials the proxy recognizes.

 

To connect to HTTP proxies, use ProxyServer and ProxyPort. To authenticate to HTTP proxies, use ProxyAuthScheme, ProxyUser, and ProxyPassword.

 

 

Firewall User

Data Type

string

Default Value

""

Remarks

The FirewallUser and FirewallPassword properties are used to authenticate against the proxy specified in FirewallServer and FirewallPort, following the authentication type specified in FirewallType.

 

Initiate OAuth

Data Type

string

Default Value

"OFF"

Remarks

The following options are available:

  1. OFF: Indicates that the OAuth flow will be handled entirely by the user. An OAuthAccessToken will be required to authenticate.
  2. GETANDREFRESH: Indicates that the entire OAuth Flow will be handled by the driver. If no token currently exists, it will be obtained by prompting the user via the browser. If a token exists, it will be refreshed when applicable.
  3. REFRESH: Indicates that the driver will only handle refreshing the OAuthAccessToken. The user will never be prompted by the driver to authenticate via the browser. The user must handle obtaining the OAuthAccessToken and OAuthRefreshToken initially.

 

 

Location

Data Type

string

Default Value

""

Remarks

The path to a directory which contains the schema files for the driver (.rsd files for tables and views, .rsb files for stored procedures). The Location property is only needed if you would like to customize definitions (e.g., change a column name, ignore a column, etc.) or extend the data model with new tables, views, or stored procedures.

The schema files used in your application must be deployed with other assemblies. You must also ensure that Location points to the folder that contains the schema files. The folder location can be a relative path from the location of the executable.

 

Logfile

Data Type

string

Default Value

""

Remarks

For more control over what is written to the log file, take a look at Verbosity.

 

Max Log File Size

Data Type

string

Default Value

""

Remarks

A string specifying the maximum size in bytes for a log file (ex: 10MB). When the limit is hit, a new log is created in the same folder with the date and time appended to the end. There is no limit by default. Values lower than 100kB will use 100kB as the value instead.

 

OAuth Access Token

Data Type

string

Default Value

""

Remarks

The OAuthAccessToken property is used to connect using OAuth. The OAuthAccessToken is retrieved from the OAuth server as part of the authentication process. It has a server-dependent timeout and can be reused between requests.

The access token is used in place of your username and password. The access token protects your credentials by keeping them on the server.

 

OAuth Client Id

Data Type

string

Default Value

""

Remarks

OAuth requires you to register your application. As part of the registration, you will receive a client Id, sometimes also called a consumer key, and a client secret. You must specify both the OAuthClientId and OAuthClientSecret to connect to an OAuth server.

 

OAuth Client Secret

Data Type

string

Default Value

""

Remarks

OAuth requires you to register your application. As part of the registration you will receive a client Id and a client secret, sometimes also called a consumer secret. You must specify both the OAuthClientId and OAuthClientSecret to connect to an OAuth server.

 

OAuth Settings Location

Data Type

string

Default Value

"%APPDATA%\\CData\\Facebook Data Provider\\OAuthSettings.txt"

Remarks

When InitiateOAuth is set to GETANDREFRESH or REFRESH, the driver saves OAuth values to a settings file to avoid requiring the user to manually enter OAuth connection properties. The default OAuthSettingsLocation is a settings file located in the %AppData%\CData folder.

 

Offline

Data Type

bool

Default Value

false

Remarks

When Offline is set to TRUE, all queries execute against the cache as opposed to the live data source.

 

Other

Data Type

string

Default Value

""

Remarks

The Other property is a semicolon-separated list of name-value pairs used in connection parameters specific to a data source.

Caching Configuration

 

   
CachePartial=True Caches only a subset of columns, which you can specify in your query.
QueryPassthrough=True Passes the specified query to the cache database instead of using the SQL parser of the driver.

 

Integration and Formatting

 

   
ConvertDateTimeToGMT Whether to convert date-time values to GMT, instead of the local time of the machine.
RecordToFile=filename Records the underlying socket data transfer to the specified file.
ClientCulture This property can be used to specify the format of data (e.g., currency values) that is accepted by the client application. This property can be used when the client application does not support the machine's culture settings. For example, Microsoft Access requires 'en-US'.
Culture This setting can be used to specify culture settings that determine how the driver interprets certain data types that are passed into the driver. For example, setting Culture='de-DE' will output German formats even on an American machine.

 

 

Pagesize

Data Type

string

Default Value

""

Remarks

The Pagesize property affects the maximum number of results to return per page from Facebook. Sometimes you may get an error asking you to request less data. The frequency of such errors can be reduced by reducing the pagesize. The maximum pagesize tends to be about 100 per page.

 

Pool Idle Timeout

Data Type

string

Default Value

""

Remarks

The allowed idle time from when the connection is free to when the connection is released and returned to the pool. The default is 60 seconds.

 

Pool Max Size

Data Type

string

Default Value

"100"

Remarks

The maximum connections in the pool. The default is 100. To disable this property, set the property value to 0 or less.

 

Pool Wait Time

Data Type

string

Default Value

""

Remarks

The max seconds to wait for a connection to become available. If a new connection request is waiting for an available connection and exceeds this time, an error is thrown. By default, new requests wait forever for an available connection.

 

Proxy Auth Scheme

Data Type

string

Default Value

"BASIC"

Remarks

This value specifies the authentication type to use to authenticate to the HTTP proxy specified by ProxyServer and ProxyPort.

Note that the driver will use the system proxy settings by default, without further configuration needed; if you want to connect to another proxy, you will need to set ProxyAutoDetect to false, in addition to ProxyServer and ProxyPort. To authenticate, set ProxyAuthScheme and set ProxyUser and ProxyPassword, if needed.

The authentication type can be one of the following:

  • BASIC: The driver performs HTTP BASIC authentication.
  • DIGEST: The driver performs HTTP DIGEST authentication.
  • NEGOTIATE: The driver retrieves an NTLM or Kerberos token based on the applicable protocol for authentication.
  • PROPRIETARY: The driver does not generate an NTLM or Kerberos token. You must supply this token in the Authorization header of the HTTP request.
If you need to use another authentication type, such as SOCKS 5 authentication, see FirewallType.

 

 

Proxy Auto Detect

Data Type

bool

Default Value

true

Remarks

By default, the driver uses the system HTTP proxy. Set this to false if you want to connect to another proxy.

To connect to an HTTP proxy, see ProxyServer.

For other proxies, such as SOCKS or tunneling, see FirewallType.

 

Proxy Password

Data Type

string

Default Value

""

Remarks

This property is used to authenticate to an HTTP proxy server that supports NTLM (Windows), Kerberos, or HTTP authentication. To specify the HTTP proxy, you can set ProxyServer and ProxyPort. To specify the authentication type, set ProxyAuthScheme.

If you are using HTTP authentication, additionally set ProxyUser and ProxyPassword to HTTP proxy.

If you are using NTLM authentication, set ProxyUser and ProxyPassword to your Windows password. You may also need these to complete Kerberos authentication.

For SOCKS 5 authentication or tunneling, see FirewallType.

By default, the driver uses the system proxy. If you want to connect to another proxy, set ProxyAutoDetect to false.

 

Proxy Port

Data Type

string

Default Value

"80"

Remarks

The port the HTTP proxy is running on that you want to redirect HTTP traffic through. Specify the HTTP proxy in ProxyServer. For other proxy types, see FirewallType.

 

Proxy Server

Data Type

string

Default Value

""

Remarks

The hostname or IP address of a proxy to route HTTP traffic through. The driver can use the HTTP, Windows (NTLM), or Kerberos authentication types to authenticate to an HTTP proxy.

If you need to connect through a SOCKS proxy or tunnel the connection, see FirewallType.

By default, the driver uses the system proxy. If you need to use another proxy, set ProxyAutoDetect to false.

 

Proxy SSL Type

Data Type

string

Default Value

"AUTO"

Remarks

This property determines when to use SSL for the connection to an HTTP proxy specified by ProxyServer. This value can be AUTO, ALWAYS, NEVER, or TUNNEL. The applicable values are the following:

 

   
AUTO Default setting. If the URL is an HTTPS URL, the driver will use the TUNNEL option. If the URL is an HTTP URL, the component will use the NEVER option.
ALWAYS The connection is always SSL enabled.
NEVER The connection is not SSL enabled.
TUNNEL The connection is through a tunneling proxy: The proxy server opens a connection to the remote host and traffic flows back and forth through the proxy.

 

 

Proxy User

Data Type

string

Default Value

""

Remarks

The ProxyUser and ProxyPassword options are used to connect and authenticate against the HTTP proxy specified in ProxyServer.

You can select one of the available authentication types in ProxyAuthScheme. If you are using HTTP authentication, set this to the username of a user recognized by the HTTP proxy. If you are using Windows or Kerberos authentication, set this property to a username in one of the following formats:

user@domain
domain\user

 

 

Pseudo Columns

Data Type

string

Default Value

""

Remarks

This setting is particularly helpful in Entity Framework, which does not allow you to set a value for a pseudo column unless it is a table column. The value of this connection setting is of the format "Table1=Column1, Table1=Column2, Table2=Column3". You can use the "*" character to include all tables and all columns; i.e., "*=*".

 

Readonly

Data Type

bool

Default Value

false

Remarks

If this property is set to true, the driver will allow only SELECT queries. 

 

RTK

Data Type

string

Default Value

""

Remarks

The RTK property may be used to license a build. Please see the included licensing file to see how to set this property. The runtime key is only available if you purchased an OEM license.

 

Search Terms

Data Type

string

Default Value

""

Remarks

Default SearchTerms if none are specified. Used for some tables, such as Users, where SearchTerms may be specified.

 

SSL Server Cert

Data Type

string

Default Value

""

Remarks

If using a TLS/SSL connection, this property can be used to specify the TLS/SSL certificate to be accepted from the server. Any other certificate that is not trusted by the machine will be rejected.

This property can take the forms:

 

   
Description Example
A full PEM Certificate (example shortened for brevity) -----BEGIN CERTIFICATE----- MIIChTCCAe4CAQAwDQYJKoZIhv......Qw== -----END CERTIFICATE-----
A path to a local file containing the certificate C:\cert.cer
The public key (example shortened for brevity) -----BEGIN RSA PUBLIC KEY----- MIGfMA0GCSq......AQAB -----END RSA PUBLIC KEY-----
The MD5 Thumbprint (hex values can also be either space or colon separated) ecadbdda5a1529c58a1e9e09828d70e4
The SHA1 Thumbprint (hex values can also be either space or colon separated) 34a929226ae0819f2ec14b4a3d904f801cbb150d

 

If not specified, any certificate trusted by the machine will be accepted. Use '*' to signify to accept all certificates (not recommended for security concerns).

 

Support Enhanced SQL

Data Type

bool

Default Value

true

Remarks

When SupportEnhancedSQL is set to true, the driver offloads as much of the SELECT statement processing as possible to Facebook and then processes the rest of the query in memory. In this way the driver can execute unsupported predicates, joins, and aggregation.

When SupportEnhancedSQL is set to false, the driver limits SQL execution to what is supported by the Facebook API.

Execution of Predicates

 

The driver determines which of the clauses are supported by the data source and then pushes them to the source to get the smallest superset of rows that would satisfy the query. It then filters the rest of the rows locally. The filter operation is streamed, which enables the driver to filter effectively for even very large datasets.

Execution of Joins

 

The driver uses various techniques to join in memory. The driver trades off memory utilization against the requirement of reading the same table more than once.

Execution of Aggregates

 

The driver retrieves all rows necessary to process the aggregation in memory.

 

Tables

Data Type

string

Default Value

""

Remarks

Listing the tables from some databases can be expensive. Providing a list of tables in the connection string improves the performance of the driver.

 

Target

Data Type

string

Default Value

""

Remarks

A default target if none is specified. Used for some tables, such as Comments, where a target may be specified.

 

Timeout

Data Type

string

Default Value

"60"

Remarks

If the Timeout property is set to 0, operations do not time out: They run until they complete successfully or encounter an error condition.

If Timeout expires and the operation is not yet complete, the driver throws an exception.

 

Use Connection Pooling

Data Type

string

Default Value

"false"

Remarks

Enables connection pooling. The default is false. See Connection Pooling for information on using connection pools.

 

Verbosity

Data Type

string

Default Value

"1"

Remarks

The verbosity level determines the amount of detail that the driver reports to the Logfile. Verbosity levels from 1 to 5 are supported. These are described below:

 

   
1 Setting Verbosity to 1 will log the query, the number of rows returned by it, the start of execution and the time taken, and any errors.
2 Setting Verbosity to 2 will log everything included in Verbosity 1, cache queries, and HTTP headers.
3 Setting Verbosity to 3 will additionally log the body of the HTTP requests.
4 Setting Verbosity to 4 will additionally log transport-level communication with the data source. This includes SSL negotiation.
5 Setting Verbosity to 5 will additionally log communication with the data source and additional details that may be helpful in troubleshooting problems. This includes interface commands.

The Verbosity should not be set to greater than 1 for normal operation. Substantial amounts of data can be logged at higher verbosities, which can delay execution times.

 

Version

Data Type

string

Default Value

"2.10"

Remarks

The Facebook Graph API version to use. Generally this property does not need to be set.

 

Views

Data Type

string

Default Value

""

Remarks

Listing the Views from some databases can be expensive. Providing a list of Views in the connection string improves the performance of the driver.




 

Tables

  1. Comments
  2. Likes
  3. Milestones
  4. Posts
  5. Users

Comments

Create, update, delete, and query the Comments for a Target. Comments may also be inserted based on a Target or deleted based on Id.

 

Table Specific Information

 

Comments in Facebook are comments about a specific thing. They are always associated with a target, which is the item the comment is directed toward. For example, this could be a post, a picture, or a video. Using this table, you can list the comments for a specific target and also insert new comments about a target.

 

Select

 

When querying comments, either the Target or the Id of the comment must be specified. For example, to retrieve all the comments about a specific post, your SELECT statement could look something like this:

SELECT * FROM Comments WHERE Target = '15526475270_410830705612736'

 

Alternatively, you can specify the Id to retrieve a specific comment. For example:

SELECT * FROM Comments WHERE Id = '15526475270_410830705612736_5193593'

 

 

Columns

 

 

 

   
Name Type ReadOnly Description
ID [KEY] String True

The Id of the comment.

Target String False

The Id of the target you are retrieving comments for. This may be an album, checkin, link, note, photo, post, status update, or video.

FromId String True

Id of the user who made the comment.

FromName String True

Name of the user who made the comment.

FromPicture String True

Picture of the user who made the comment.

Message String False

The text of the comment.

MessageTags String False

Aggregate of tags contained in the message.

Likes Integer True

The number of likes the comment has.

CommentsCount Integer True

The number of comments in reply to this comment.

LikesData String True

Aggregate of likes information on the comment.

UserLikes Boolean True

Boolean indicating if the authenticated user likes the comment.

CanRemove Boolean True

Boolean indicating if the comment can be removed.

AttachmentType String True

The type of attachment associated with the comment.

AttachmentUrl String True

URL of the attachment.

AttachmentTargetId String True

Id of the target attachment.

AttachmentTargetUrl String True

URL of the target attachment.

AttachmentMediaImageSrc String True

The source URL of the image attachment.

CreatedTime Datetime True

The time the comment was created.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
offset String

Which result to begin returning results from. Used for manual paging of results.

rows@next String

This is used to page through multiple pages of results and should not be set manually.

 

 

 

Likes

Create, delete, and query the Likes for a Target. Alternatively, lists Pages that the specified User or Page Likes. Authentication is required to use this table.

 

Table Specific Information

 

Likes in Facebook represent the users that like a particular target. The target may be a post, page, picture, or other type of valid entity that may have likes associated with it.

 

Select

 

When selecting likes, specify a target. The target represents the username or Id of the entity that likes are being retrieved for. For example:

SELECT Id, Name, Picture FROM Likes WHERE Target = '15526475270_410830705612736'

 

If a user or page is specified as the target for likes, then the pages that the user or page likes will be returned. For example:

SELECT Id, Name, Username, Category FROM Likes WHERE Target = 'facebook'

 

If no target is specified, the currently authenticated user will be used as the target. In this case, the pages that the authenticated user likes will be returned.

 

Columns

 

 

 

   
Name Type ReadOnly Description
ID [KEY] String True

The Id of a user who likes the target, which may or may not be combined with the target Id. The user Id will be after the final '_'.

Target [KEY] String False

The Id or username of the target being liked. This may be a post, page, picture, or other valid id with likes.

Name String True

The name of the user who likes the target. May alternatively be the name of a page.

Username String True

The username of a page when retrieving pages a page has liked.

Picture String True

Picture of the user who likes the target. May alternatively be the picture of a page.

Category String True

The category of the user or page.

CreatedTime Datetime True

The time the like was created, if available.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
offset String

Which result to begin returning results from. Used for manual paging of results.

rows@next String

This is used to page through multiple pages of results and should not be set manually.

 

 

 

Milestones

Create, update, delete, and query a list of Milestones for the given Page. 

 

Columns

 

 

 

   
Name Type ReadOnly Description
ID [KEY] String True

The Id of the milestone.

Target String False

The Id of the page you are retrieving milestones from.

Title String False

The title of the milestone.

Description String False

The description of the milestone.

StartTime Date False

The end time for the milestone.

FromId String True

Id of the user who made the milestone.

FromName String True

Name of the user who made the milestone.

FromPicture String True

Picture of the user who made the milestone.

FromCategory String True

Category of the user who made the milestone.

CreatedTime Datetime True

When the milestone was created. Requires the read_stream permission.

UpdatedTime Datetime True

When the milestone was last updated. Requires the read_stream permission.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
offset String

Which result to begin returning results from. Used for manual paging of results.

rows@next String

This is used to page through multiple pages of results and should not be set manually.

 

 

 

Posts

Create, delete, and query the Posts for a Target based on either the Target or Id. Posts can also be inserted based on a Target, or deleted based on Id. This table requires authentication.

 

Table Specific Information

 

Posts in Facebook are posts to a user's profile feed. Posts can be made to a user, page, application, group, or event.

 

Select

 

When selecting posts, a target may be specified. The target represents a user, page, event, or another valid entity that may have posts for it. If no target is specified, the authenticated user will be used as the target. For example, to retrieve posts made by a user:

SELECT * FROM Posts WHERE Target = 'UserId'

 

If you know the post Id, you can specify the Id to obtain information about the specific post. For example:

SELECT * FROM Posts WHERE Id = 'PostId'

 

When querying posts, elements may be retrieved by specifying either the CreatedTime or the UpdatedTime. For example:

SELECT * FROM Posts WHERE Target='facebook' AND CreatedTime >= '1/1/2012' AND CreatedTime <= '2/1/2012'

 

Columns

 

 

 

   
Name Type ReadOnly Description
ID [KEY] String True

The Id of the post.

Target String False

The Id or username of the target you are retrieving posts for or are posting to. This can be an event, group, page, or user.

Type String True

The type of post.

FromId String True

Id of the user who made the post.

FromName String True

Name of the user who made the post.

FromPicture String True

Picture of the user who made the post.

FromCategory String True

Category of the user who made the post. FromCategory can only be retrieved if the other From* fields are not selected.

ToData String True

An aggregate of users the post was made to.

Message String False

The message of the post. A message is required when inserting a post.

MessageTags String True

An aggregate of objects tagged in the message such as users, pages, etc.

Link String False

The link attached to the post.

Name String False

The name of the link.

Caption String False

The caption of the link, which appears beneath the link name.

Description String False

A description of the link, appears beneath the link caption.

Picture String False

A link to the picture included in the post.

Source String True

A URL to a flash movie or video file embedded within the post.

Icon String True

Link to an icon representing the type of post.

Actions String True

An aggregate of available actions on the post such as commenting or liking.

CommentsCount Integer True

The number of comments for the post.

LikesCount Integer True

The number of times the post has been liked.

SharesCount Integer True

The number of times the post has been shared.

PlaceId String False

The Id of the location associated with the post, if any.

PlaceName String True

The name of the location associated with the post, if any.

ObjectId String True

The Facebook object Id for an uploaded photo or video.

ApplicationId String True

Id of the application this post came from.

ApplicationName String True

Name of the application this post came from.

ApplicationCanvasName String True

Information about the application used to create the entity.

ApplicationNamespace String True

Information about the application used to create the entity.

Story String True

Text of stories not intentionally generated by users, such as those generated when two users become friends; you must have the Include Recent Activity Stories migration enabled in your app to retrieve these stories. Requires the read_stream permission.

StoryTags String True

An aggregate of objects (users, pages, etc.) associated with the story.

LikesData String True

An aggregate of like data.

CommentsData String True

An aggregate of comments for this post.

WithTagsData String True

Objects (users, pages, etc) tagged as being with the publisher of the post.

CreatedTime Datetime True

When the post was created.

UpdatedTime Datetime True

When the post was last updated.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String

This is used to page through multiple pages of results and should not be set manually.

TaggedUser String

If set to an Id or username, it will retrieve posts where the specified user has been tagged. Requires the read_stream permission.

LocationUser String

If set to an Id or username, it will retrieve location posts where the user has been tagged. Requires the user_photos and user_status permissions.

 

 

 

Users

Query Users by SearchTerms or Id.

 

Table Specific Information

 

Users in Facebook are the various user accounts on Facebook.

 

Select

 

When selecting users, SearchTerms may be specified. The SearchTerms represent a space-separated list of terms to retrieve usernames on. For example:

SELECT * FROM Users WHERE SearchTerms = 'marlon brando'

 

If you know the user Id, you can specify the Id to obtain information about the specific user. For example:

SELECT * FROM Posts WHERE Id = 'UserId'
Columns

 

 

 

   
Name Type ReadOnly Description
ID [KEY] String True

The Id of the user.

Searchterms String False

The terms used to search the users if searching users.

Name String False

The full name of the user.

Picture String True

Picture of the user.

FirstName String False

The first name of the user.

MiddleName String False

The middle name of the user.

LastName String False

The last name of the user.

Gender String False

The gender, male or female, of the user.

The allowed values are male, female.

Locale String False

The locale of the user.

Languages String False

An aggregate of data containing languages the user speaks. Requires the user_likes permission.

Link String False

The URL of the profile for the user on Facebook.

Timezone String False

The timezone offset from UTC. Available only for the current user.

Verified Boolean False

The account verification status of the user.

Birthday String False

The birthday of the user. Requires the user_birthday or friends_birthday permission.

InspirationalPeople String False

An aggregate of people who inspire the user. Requires the user_likes or friends_likes permission.

Education String False

An aggregate of data about the education of the user. Requires the user_education_history or friends_education_history permission.

Email String False

The email address of the user. Requires the email permission.

HometownName String False

The hometown name of the user. Requires the user_hometown or friends_hometown permission.

HometownId String False

The hometown name of the user. Requires the user_hometown or friends_hometown permission.

InterestedIn String False

An aggregate of genders the user is interested in. Requires the user_relationship_details or friends_relationship_details permission.

LocationName String False

The current city name of the user. Requires the user_location or friends_location permission.

LocationId String False

The current city Id of the user. Requires the user_location or friends_location permission.

Political String False

The political view of the user. Requires the user_religion_politics or friends_religion_politics permission.

FavoriteAthletes String False

An aggregate of the favorite athletes of the user. Requires the user_likes or friends_likes permission.

FavoriteTeams String False

An aggregate of the favorite teams of the user. Requires the user_teams or friends_teams permission.

Quotes String False

The favorite quotes of the user. Requires the user_about_me or friends_about_me permission.

RelationshipStatus String False

The relationship status of the user. Requires the user_relationships or friends_relationships permission.

The allowed values are Single, In a relationship, Engaged, Married, It's complicated, In an open relationship, Widowed, Separated, Divorced, In a civil union, In a domestic partnership.

Religion String False

The religion of the user. Requires the user_religion_politics or friends_religion_politics permission.

SignificantOtherName String False

The name of the significant other of the user. Requires the user_relationships or friends_relationships permission.

SignificantOtherId String False

The Id of the significant other of the user. Requires the user_relationships or friends_relationships permission.

Website String False

The URL of the personal website of the user. Requires the user_website or friends_website permission.

Work String False

An aggregate of the work history of the user. Requires the user_work_history or friends_work_history permission.

UpdatedTime Datetime False

The last time the profile was updated of the user. Changes to the languages, link, timezone, verified, interested_in, favorite_athletes, favorite_teams, and video_upload_limits are not reflected in this value.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String

This is used to page through multiple pages of results and should not be set manually.

 

 




 

Views

  1. AdAccounts
  2. AdCreatives
  3. AdInsights
  4. AdInsightsActions
  5. Ads
  6. AdScheduledReports
  7. AdSets
  8. Albums
  9. Applications
  10. AuthorizedAdAccounts
  11. Books
  12. Campaigns
  13. Events
  14. Friends
  15. Games
  16. GroupMemberships
  17. Groups
  18. InsightsByConsumptionType
  19. InsightsByFeedbackType
  20. InsightsByLikeSourceType
  21. InsightsByPaidStatus
  22. InsightsByReactionTotals
  23. InsightsByStoryType
  24. InsightsByTabType
  25. LeadValues
  26. Movies
  27. Music
  28. Pages
  29. Permissions
  30. Photos
  31. Places
  32. ScheduledReportRuns
  33. SimpleInsights
  34. SimpleVideoInsights
  35. TaggedBy
  36. Television
  37. VideoInsightsByActionType
  38. VideoInsightsByDistributionType
  39. VideoInsightsByReactionType
  40. Videos
  41. Wall

AdAccounts

Query the Ad Accounts available for a User. Accessing Ad Account information requires the ads_read permission.

 

Table Specific Information

 

AdAccounts in Facebook are the accounts you have available in Facebook for creating Ads on. The Ids for them are always returned in the format "act_" and when they are used as a Target in requests for other tables, the Id with the prefix "act_" must always be used.

 

Select

 

When querying AdAccounts, only the Id can be used to filter results. For instance:

SELECT * FROM AdAccounts WHERE Id = 'act_123456'

 

Otherwise if Id is not specified, the accounts available for your user account will be listed.

Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of Ad Account.
AccountId String The Id of the Ad Account when viewed directly in Facebook.
AccountStatus Integer Status of the account. 1 = Active, 2 = Disabled, 3 = Unsettled, 7 = Pending Review, 9 = in Grace Period, 101 = temporarily unavailable, 100 = pending closure.
Age Double Amount of time the ad account has been open, in days.
AmountSpent Integer Current total amount spent by the account. This can be reset.
Balance Integer Bill amount due.
BusinessCity String City for business address.
BusinessCountryCode String Country code for the business address.
BusinessName String The business name for the account.
BusinessState String State abbreviation for business address.
BusinessStreet String First line of the business street address for the account.
BusinessStreet2 String Second line of the business street address for the account.
BusinessZip String Zip code for business address.
Capabilities String Capabilities allowed for this ad account.
CreatedTime Datetime The time the account was created.
Currency String The currency used for the account, based on the corresponding value in the account settings.
MinCampaignGroupSpendCap String The minimum campaign group spend limit.
Name String Name of the account; note that many accounts are unnamed, so this field may be empty.
OffsitePixelsTosAccepted String Indicates whether the offsite pixel Terms Of Service contract was signed.
OwnerId String Facebook ID of the owner fo the Ad Account.
SpendCap Integer The maximum that can be spent by this account after which campaigns will be paused. A value of 0 signifies no spending-cap.
TimezoneId String ID for the timezone.
TimezoneName String Name for the time zone.
TimezoneOffsetHoursUTC Integer Time Zone difference from UTC.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

AdCreatives

Query information about an Ad Creative or the Ad Creatives on a specific Ad Account, Ad Set, or Ad. Accessing Ad Creative information requires the ads_read permission.

 

Table Specific Information

 

AdCreatives in Facebook represent a collection of the creatives for specific Ads in Facebook.

 

Select

 

When querying ad creatives, either the Id or Target must be used to filter results. The Target may be an ad account, ad set, or ad. For instance:

SELECT * FROM AdCreatives WHERE Target = 'adid'
Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of Ad Set.
Target String The Ad Account Id or Campaign Id to get Ad Sets of.
Name String The name of the Ad Creative.
ApplinkTreatment String Deep link fallback behavior for dynamic product ads if the app is not installed.
Body String The body of the ad.
CallToActionType String The call to action button text and header text of legacy ads.
EffectiveInstagramStoryId String The ID of an Instagram post to use in an ad.
ImageHash String Image hash for an image you can use in creatives.
ImageUrl String A URL for the image for this creative. The image specified at this URL will be saved into the ad account's image library.
InstagramActorId String Instagram actor ID.
InstagramPermalinkUrl String Instagram permalink.
InstagramStoryId String The ID of an Instagram post for creating ads.
LinkOgId String The Open Graph (OG) ID for the link in this creative if the landing page has OG tags.
LinkUrl String Used to identify a specific landing tab on the Page (e.g. a Page tab app) by the Page tab's URL.
ObjectId String The ID of the promoted_object or object that is relevant to the ad and ad type.
ObjectStoryId String The ID of a page post to use in an ad.
ObjectType String The type of object that is being advertised.
ObjectUrl String Destination URL for a link ads not connected to a page.
ProductSetId String The ID of the product set for this creative.
RunStatus String The run status of this creative.
TemplateUrl String The Tracking URL for dynamic product ads.
ThumbnailUrl String The URL to a thumbnail for this creative.
Title String Title for a link ad (not connected to a Page).
UrlTags String A set of query string parameters which will replace or be appended to urls clicked from page post ads, message of the post, and canvas app install creatives only.
UsePageActorOverride Boolean If this is true, we will show the page actor for mobile app ads.
AdLabels String Ad Labels that are associated with this creative.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

AdInsights

Query an Ad Report. Accessing Ad Report information requires the ads_read permission.

 

Table Specific Information

 

AdInsights in Facebook can be requested with a great amount of detail to simulate the same sort of information that can be retrieved in a report.

 

Select

 

 

When requesting AdInsights, a Target must be specified. This indicates what element to retrieve the insights from. It can be an AdAccount, Campaign, AdSet, or an Ad. For instance:

SELECT * FROM AdInsights WHERE Target = 'act_123456'

 

A date range can be specified using DateStart and DateEnd, or DatePreset must also be specified. For instance:

SELECT DateStart, DateEnd, AdAccountId, Spend, Impressions FROM AdInsights WHERE Target = 'act_123456' AND DateStart >= '01/01/2015' AND DateEnd <= '03/31/2015'
 
SELECT DateStart, DateEnd, AdAccountId, Spend, Impressions FROM AdInsights WHERE Target = 'act_123456' AND DatePreset='last_90d'

 

The available values for DatePreset are:

  • lifetime
  • today
  • yesterday
  • this_week_sun_today
  • this_week_mon_today
  • last_week_sun_sat
  • last_week_mon_sun
  • last_3d
  • last_7d
  • last_14d
  • last_28d
  • last_30d
  • last_90d
  • this_month
  • last_month

 

The TimeIncrement can used to specify how many days should be included in each report row. For instance:

SELECT DateStart, DateEnd, AdAccountId, Age, Spend, Impressions FROM AdInsights WHERE Target = 'act_123456' AND DatePreset='last_90d' AND TimeIncrement='7'
 
SELECT DateStart, DateEnd, AdAccountId, Age, Spend, Impressions FROM AdInsights WHERE Target = 'act_123456' AND DatePreset='last_90d' AND TimeIncrement='monthly'

 

The Level column can be used to specify what level insights are retrieved at. This can be set to ad,adset,campaign, or account. For instance:

SELECT DateStart, DateEnd, AdAccountId, Age, Spend, Impressions FROM AdInsights WHERE Target = 'act_123456' AND Level='campaign'

 

There are a number of breakdown columns. In general, only one breakdown column can be selected at a time. If you use SELECT *, no breakdown columns will be used. The available breakdown columns are:

  • Age: Can also be selected with Gender
  • Country
  • FrequencyValue
  • Gender: Can also be selected with Age
  • HStatsByAdvertiserTZ (Hourly Stats by Advertizer Timezone)
  • HStatsByAudienceTZ (Hourly Stats by Audience Timezone)
  • ImpressionDevice: Can also be selected with PublisherPlatform or both PublisherPlatform and PlatformPosition.
  • PlatformPosition: Must be selected with PublisherPlatform. Can also be selected with ImpressionDevice.
  • PublisherPlatform: Can be selected with PlatformPosition, ImpressionDevice, or both PlatformPosition and ImpressionDevice.
  • ProductId
  • Region

 

Most other columns not already mentioned can be used with standard SQL WHERE clause modifiers. For instance:

SELECT DateStart, DateEnd, AdAccountId, Spend, Impressions FROM AdInsights WHERE Target = 'act_123456' WHERE Impressions > 10000 AND Spend < 1000

 

Both the DatePreset and the breakdowns are subject to frequent changes by Facebook. The lists above may be outdated due to Facebook changes. To see the most currently available breakdowns and date presets, see the documentation on Facebook for parameters and breakdowns: https://developers.facebook.com/docs/marketing-api/insights/

Columns

 

 

 

   
Name Type Description
Target String The Id of the Account, Campaign, Ad Group, or Ad to get insights for.
DatePreset String An alternative to specifying the DateStart and DateEnd. A date range will automatically be calculated based on the specified preset value.
DateStart Date The starting date to retrieve insights for. In the Facebook UI, this is the Report Start field. In the Facebook UI, this is the Report Start field.
DateEnd Date The ending date to retrieve insights for. In the Facebook UI, this is the Report End field. In the Facebook UI, this is the Report End field.
TimeIncrement String The number of days of data aggregation. An int (1-90) or one of monthly or all_days. This value splits the range or preset date into smaller increments.

The default value is 1.

Level String The level to represent the results at.
ActionAttributionWindows String A comma separated list which determines what is the attribution window for the actions. For example, 28d_click means the API returns all actions that happened 28 days after someone clicked on the ad. The default option means [1d_view,28d_click]. Possible values include 1d_view, 7d_view, 28d_view, 1d_click, 7d_click, 28d_click, default.
AdAccountId String The Id of the Ad Account associated with the report row.
AdAccountName String The name of the Ad Account associated with the report row.
CampaignId String The Id of the Campaign associated with the report row.
CampaignName String The name of the Campaign associated with the report row.
AdSetId String The Id of the Ad Set associated with the report row.
AdSetName String The name of the Ad Set associated with the report row.
AdId String The Id of the Ad associated with the report row.
AdName String The name of the Ad associated with the report row.
Actions String The number of actions taken on your ad, Page, app or event after your ad was served to someone, even if they didn't click on it. Actions include post reactions (the postlikes field), link clicks (the inlineLinkClicks field), app installs, conversions, event responses, and more. For example, 2 Page likes and 2 comments would be counted as 4 actions.
CallToActionClicks Long Total number of clicks on the call to action button of the ad. In the Facebook UI, this is the Button Clicks field.
Clicks Long The total number of clicks on your ad. Depending on what you're promoting, this can include Page likes, event responses or app installs. In the Facebook UI, this is the Clicks (All) field.
CostPer10SececondVideoView String The average cost per 10-second video view, calculated as the amount spent divided by the number of 10-second video views.
CostPerActionType String The average you've spent on actions. For example, if you spent $20 and you got 10 Page likes, each one cost an average of $2.
CostPerEstimatedAdRecallers Double The average cost per additional person we estimate will recall seeing your ad if asked within 2 days.
CostPerInlineLinkClick Double The average cost per click on links in the ad.
CostPerInlinePostEngagement Double The average cost per engagement on the post.
CostPerTotalAction Double The average you've spent on actions. For example, if you spent $20 and you got 10 Page likes, each one cost an average of $2.
CostPerUniqueClick Double The average cost per unique click for these ads, calculated as the amount spent divided by the number of unique clicks received.
CostPerUniqueActionTypeAggregate String The average you paid for each type of unique action.
CostPerUniqueInlineLinkClick Double The average you paid for each unique inline link click.
CPC Double The average cost per click for these ads, calculated as the amount spent divided by the number of clicks received.
CPM Double The average cost you've paid to have 1,000 impressions on your ad.
CPP Double The average cost you've paid to have your ad served to 1,000 unique people.
CTR Double The number of clicks you received divided by the number of impressions. In the Facebook UI, this is the CTR (All) % field.
EstimatedAdRecallRate Double The estimated number of people who recall your ad divided by the number of people your ad reached.
EstimatedAdRecallers Double The additional number of people we estimate will remember seeing your ads if asked within 2 days.
Frequency Double The average number of times your ad was served to each person.
Impressions Long The number of times your ad was served. On our mobile apps an ad is counted as served the first time it's viewed. On all other Facebook interfaces, an ad is served the first time it's placed in a person's News Feed or each time it's placed in the right column.
InlineLinkClicks Long Total number of clicks on links in the ad.
InlineLinkClicksCounter Double Click-through rate for inline clicks to link.
InlinePostEngagement Long Total number of engagements on the post.
Objective String The objective you selected for your campaign. Your objective reflects the goal you want to achieve with your advertising.
Reach Long The number of people your ad was served to.
RelevanceScore String Ad relevance score is multiple metrics related to how your audience responded to your ad. Only available at ad level and will not be returned for aggregations at other levels.
SocialClicks Long The number of clicks your ad receives when it's shown with social information.
SocialImpressions Long The number of times your ad was served, with social information. For example, if 3 people are served an ad 2 times each and it includes information about a friend liking your Page, it counts as 6 social impressions.
SocialReach Long The number of people your ad was served to with social information. For example, if 3 people see an ad 2 times each that says a friend likes your Page, it counts as 3 social reaches.
Spend Double The total amount you've spent so far.
TotalActionValue Double The total revenue returned from conversions or Facebook credit spends that occurred on your website or app.
TotalActions Long The number of actions taken on your ad, Page, app or event after your ad was served to someone, even if they didn't click on it. Actions include Page likes, app installs, conversions, event responses and more. For example, 2 Page likes and 2 comments would be counted as 4 actions. In the Facebook UI, this is the Actions field.
TotalUniqueActions Long The number of unique people who took an action such as liking your Page or installing your app as a result of your ad. For example, if the same person likes and comments on a post, they will be counted as 1 unique person.
UniqueActions String The number of actions taken on your ad, Page, app or event after your ad was served to someone, even if they didn't click on it. Actions include Page likes, app installs, conversions, event responses and more. For example, 2 Page likes and 2 comments would be counted as 4 actions.
UniqueClicks Long The total number of unique people who have clicked on your ad. For example, if 3 people click on the same ad 5 times, it will count as 3 unique clicks.
UniqueCTR Double The number of people who clicked on your ad divided by the number of people you reached. For example, if you received 20 unique clicks and your ad was served to 1,000 unique people, your unique click-through rate would be 2%.
UniqueInlineLinkClicks Long The number of unique inline link clicks that your ad got. In the Facebook UI, this is the Unique Clicks to Link field.
UniqueInlineLinkClickCounter Double Click-through rate for unique inline clicks to link.
UniqueLinkClicksCounter Double Unique click-through rate for clicks to link. The number of people who clicked on the link in your ad that directs people off Facebook divided by the number of people you reached. Example: if you received 20 unique clicks to link and your ad was shown to 1,000 unique people, your unique click-through rate would be 2%.
UniqueSocialClicks Long The number of individuals who clicked this ad while it had social context.
Video15SecondWatchedActions String The number of times your video was viewed more than 15 seconds, including views that skipped to this point.
Video30SecondWatchedActions String The number of times your video was viewed more than 30 seconds, including views that skipped to this point.
Video25PercentWatchedActions String The number of times your video was viewed to 25% of its length, including views that skipped to this point.
Video50PercentWatchedActions String The number of times your video was viewed to 50% of its length, including views that skipped to this point.
Video75PercentWatchedActions String The number of times your video was viewed to 75% of its length, including views that skipped to this point.
Video95PercentWatchedActions String The number of times your video was viewed to 95% of its length, including views that skipped to this point.
Video100PercentWatchedActions String The number of times your video was viewed to 100% of its length, including views that skipped to this point.
VideoAvgPercentWatchedPerSession String The percentage of your video somebody watches per session, averaged across all sessions of your video where the video auto-played or was clicked to play. These metrics are not available for Live video.
VideoAvgTimeWatchedActions String This is the total video watch time for your video divided by the total number of plays of your video.
Age String The age range for the metrics in this row. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
Country String The country for the metrics in this row. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
DevicePlatform String The device or platform used for viewing the ad. This is a breakdown column that may not be selected with other breakdown columns.
DMA String The designated marketing area. This is a breakdown column that may not be selected with other breakdown columns.
FrequencyValue String The number of times an ad in your Reach and Frequency campaign was served to each person. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
Gender String The gender for the metrics in this row. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
HStatsByAdvertiserTZ String Time period over which the stats were taken for the advertiser. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
HStatsByAudienceTZ String Time period over which the stats were taken for the audience. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
ImpressionDevice String The devices used to view the Ad. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
PlacePageId String The place page used if applicable. This is a breakdown column that may not be selected with other breakdown columns.
PlatformPosition String The position on the platform.
ProductId String The product Id advertised in the Ad. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
PublisherPlatform String The platforms the ads were published on.
Region String The region someone viewed the Ad from. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

AdInsightsActions

Query an Ad Report. Accessing Ad Report information requires the ads_read permission.

 

Table Specific Information

 

AdInsightsActions represents a breakdown of the Actions column from the AdInsights. See AdInsights for general information on querying AdInsights.

 

Select

 

When requesting AdInsightsActions, a Target must be specified. This indicates what element to retrieve the insights from. It can be an AdAccount, Campaign, AdSet, or an Ad. For instance:

SELECT * FROM AdInsightsActions WHERE Target = 'act_123456'

 

The specific collection to retrieve from AdInsightsActions may be specified via ActionCollection. If none is specified, Actions is used. Each input represents an available column from AdInsights where a collection of actions would return. Furthermore, multiple collections may be specified via the IN clause. For instance:

SELECT * FROM AdInsightsActions WHERE Target = 'act_123456' AND ActionCollection = 'UniqueActions'
 
SELECT * FROM AdInsightsActions WHERE Target = 'act_123456' AND ActionCollection IN ('Actions','UniqueActions')

 

Just as in the available selection criterias from AdInsights, breakdowns are available. Please see AdInsights for details on breakdowns. Additional breakdowns for AdInsightsActions include ActionType, ActionCanvasComponentName, ActionCarouselCardId, ActionCarouselCardName, ActionDestination, ActionDevice, ActionLinkClickDestination, ActionReaction, ActionTargetId, ActionVideoSound, and ActionVideoType.

ActionAttributionWindows is available to input a comma separated list of attribution windows. For instance:

SELECT * FROM AdInsightsActions WHERE Target='act_123456' AND level='ad' AND ActionAttributionWindows='1d_view,7d_view,28d_click'
Columns

 

 

 

   
Name Type Description
Target String The Id of the Account, Campaign, Ad Group, or Ad to get insights for.
DatePreset String An alternative to specifying the DateStart and DateEnd. A date range will automatically be calculated based on the specified preset value.
DateStart Date The starting date to retrieve insights for. In the Facebook UI, this is the Report Start field. In the Facebook UI, this is the Report Start field.
DateEnd Date The ending date to retrieve insights for. In the Facebook UI, this is the Report End field. In the Facebook UI, this is the Report End field.
TimeIncrement String The number of days of data aggregation. An int (1-90) or one of monthly or all_days. This value splits the range or preset date into smaller increments.

The default value is 1.

Level String The level to represent the results at.
ActionAttributionWindows String A comma separated list which determines what is the attribution window for the actions. For example, 28d_click means the API returns all actions that happened 28 days after someone clicked on the ad. The default option means [1d_view,28d_click]. Possible values include 1d_view, 7d_view, 28d_view, 1d_click, 7d_click, 28d_click, default.
ActionCollection String The action collection to retrieve. The available values are: Actions, ActionValues, CanvasComponentAvgPctView, CostPer10SecVideoView, CostPerActionType, CostPerUniqueActionType, UniqueActions, Video10SecWatchedActions, Video15SecWatchedActions, Video30SecWatchedActions, VideoAvgPercentWatchedActions, VideoAvgTimeWatchedActions, VideoCompleteWatchedActions, VideoP100WatchedActions, VideoP25WatchedActions, VideoP50WatchedActions, VideoP75WatchedActions, VideoP95WatchedActions, WebsiteClicks, WebsiteCtr

The default value is Actions.

AdAccountId String The Id of the Ad Account associated with the report row.
AdAccountName String The name of the Ad Account associated with the report row.
CampaignId String The Id of the Campaign associated with the report row.
CampaignName String The name of the Campaign associated with the report row.
AdSetId String The Id of the Ad Set associated with the report row.
AdSetName String The name of the Ad Set associated with the report row.
AdId String The Id of the Ad associated with the report row.
AdName String The name of the Ad associated with the report row.
ActionType String The kind of actions taken on your ad, Page, app or event after your ad was served to someone, even if they didn't click on it.
ActionValue String Metric value of default attribution window.
Action1dClick String Metric value of attribution window 1 day after clicking the ad.
Action1dView String Metric value of attribution window 1 day after viewing the ad.
Action7dClick String Metric value of attribution window 7 days after clicking the ad.
Action7dView String Metric value of attribution window 7 days after viewing the ad.
Action28dClick String Metric value of attribution window 28 days after clicking the ad.
Action28dView String Metric value of attribution window 28 days after viewing the ad.
ActionCanvasComponentName String Name of a component within a Canvas ad.
ActionCarouselCardId String The ID of the specific carousel card that people engaged with when they saw your ad.
ActionCarouselCardName String The specific carousel card that people engaged with when they saw your ad. The cards are identified by their headlines.
ActionDestination String The destination where people go after clicking on your ad.
ActionDevice String The device on which the conversion event you are tracking occurred.
ActionLinkClickDestination String The destination where people go after clicking link on your ad that directs people off Facebook.
ActionReaction String The number of reactions on your ads or boosted posts.
ActionTargetId String The id of destination where people go after clicking on your ad.
ActionVideoSound String The sound status (on/off) when user watches your video ad.
ActionVideoType String Video metrics breakdown.
Age String The age range for the metrics in this row. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
Country String The country for the metrics in this row. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
DevicePlatform String The device or platform used for viewing the ad. This is a breakdown column that may not be selected with other breakdown columns.
DMA String The designated marketing area. This is a breakdown column that may not be selected with other breakdown columns.
FrequencyValue String The number of times an ad in your Reach and Frequency campaign was served to each person. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
Gender String The gender for the metrics in this row. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
HStatsByAdvertiserTZ String Time period over which the stats were taken for the advertiser. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
HStatsByAudienceTZ String Time period over which the stats were taken for the audience. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
ImpressionDevice String The devices used to view the Ad. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
PlacePageId String The place page used if applicable. This is a breakdown column that may not be selected with other breakdown columns.
PlatformPosition String The position on the platform.
ProductId String The product Id advertised in the Ad. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.
PublisherPlatform String The platforms the ads were published on.
Region String The region someone viewed the Ad from. This is a breakdown column and selecting this column will cause results to be further broken down by this metric.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Ads

Query information about an Ad or the Ads in a specific Ad Set, Campaign, or Ad Account. Accessing Ad Information requires the ads_read permission.

 

Table Specific Information

 

Ads in Facebook represent individual ads that have been created.

 

Select

 

When querying ad accounts, either the Id or Target must be used to filter results. For instance:

SELECT * FROM Ads WHERE Target = 'act_123456'

 

Additionally, UpdatedTime may be used with the > or >= operators to retrieve only records newer than a certain date. For instance:

SELECT * FROM Ads WHERE Target = 'act_123456' AND UpdatedTime > '01/01/2016' 
Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of Ad Set.
Target String The Ad Account Id, Campaign Id, or Ad Set Id to get Ads in.
Name String The name of the Ad.
AdStatus String The status of the Ad.
BidInfo String The value of the bid info taken from the Ad Set.
BidType String The bid type value taken from the Ad Set.
CampaignId String The Id of the Campaign the Ad belongs to.
AdSetId String The Id of the Ad Set the Ad belongs to.
AdCreativeId String The Id of the Ad Creative associated with the Ad.
ConfiguredStatus String The configured status of the ad. Prefer using 'status' instead of this.
CreatedTime Datetime The time when the Ad was created.
SocialPrefs String Whether or not to show social context for share actions. This option is applicable to only link ads from a page.
UpdatedTime Datetime When the Ad was last updated.
ConversionSpecs String The Ad's conversion specs.
FailedDeliveryChecks String Possible checks that could have failed which will prevent the Ad from showing up.
Recommendations String If there are recommendations for this ad, this field includes them. Otherwise, this field will be null.
TrackingSpecs String The Ad's tracking specification. This field will be defaulted based on the objective, if not set to NONE, or based on the ad creative.
TargetingGenders Integer Indicates gender-based targeting. 0=all, 1=male, 2=female.
TargetingAgeMax Integer Maximum age. If used, must be 65 or lower.
TargetingAgeMin Integer Minimum age. If used, must be 13 or higher. If omitted, will default to 18.
TargetingCountries String Values for country targeting.
TargetingLocationTypes String Values for the types of locations to target.
TargetingRegions String The state, province, or region.
TargetingCities String Cities to target with a radius and distance.
TargetingZips String The zip codes used for targeting.
TargetingCustomLocations String Any custom locations to target.
TargetingGeoMarkets String They key for the market. The destination market areas (DMA) and keys are in the format DMA:NUMBER, such as DMA:501.
TargetingInterests String Interests to target based on.
TargetingBehaviors String Behaviors to target based on.
TargetingPageTypes String The types of pages to use when targeting. Values may include desktop, feed, desktopfeed, mobile, rightcolumn, rightcolumn-and-mobile, home, mobilefeed-and-external, desktop-and-mobile-and-external, feed-and-external, rightcolumn-and-mobile-and-external.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

AdScheduledReports

Query the Scheduled Reports for a given Ad Account. Accessing Scheduled Report information requires the ads_read permission.

 

Table Specific Information

 

The scheduled reports are a list of reports scheduled to run every day for your account. These can be maintained in the Facebook Ads Manager. Daily runs of these reports are available from ScheduledReportRuns.

 

Select

 

When querying scheduled reports, the Target must be used to filter results. For instance:

SELECT * FROM AdScheduledReports WHERE Target = 'act_123456'
Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of Scheduled Report.
Target String The Id of the Ad Account to retrieve reports from. This must be specified to retrieve scheduled reports.
DatePreset String The preset value to use for the date range.
Name String The name of the report.
ScheduleFrequency String How frequently to execute this report, daily, weekly or monthly.
SortBy String How the report should be sorted.
SortDir String The direction to sort the report.
StartDate Date The first day to schedule running the report.
Status String The status of the report, Active or Paused.
TimeIncrement String Group result by N days (1-90) or monthly or all_days.
DataColumns String The columns to retrieve in the report.
Emails String Email addresses to notify when this report is ready.
Filters String The filters to apply to this report.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

AdSets

Query information about an Ad Set or the Ad Sets on a specific Campaign or Ad Account. Accessing Ad Set information requires the ads_read permission.

 

Table Specific Information

 

AdSets in Facebook represent a collection of Ads in Facebook.

 

Select

 

When querying ad sets, either the Id or Target must be used to filter results. The Target may be an ad account, or a campaign. For instance:

SELECT * FROM AdSets WHERE Target = 'act_123456'
Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of Ad Set.
Target String The Ad Account Id or Campaign Id to get Ad Sets of.
Name String The name of the Ad Set.
BudgetRemaining Integer The amount of budget remaining for this Ad Set.
CampaignId String The Ad Campaign this ad set is a part of.
AdSetStatus String The status of the Ad Set.
BillingEvent String The billing event that this adset is using: APP_INSTALLS: Pay when people install your app. CLICKS: Pay when people click anywhere in the ad. IMPRESSIONS: Pay when the ads are shown to people. LINK_CLICKS: Pay when people click on the link of the ad. OFFER_CLAIMS: Pay when people claim the offer. PAGE_LIKES: Pay when people like your page. POST_ENGAGEMENT: Pay when people engage with your post. VIDEO_VIEWS: Pay when people watch videos.
CreatedTime Datetime When the Ad Set was created.
DailyBudget Integer The daily budget of the set defined in your account currency, it is allowed only for ad sets with a duration longer than 24 hours.
LifetimeBudget Double The lifetime budget of the set defined in your account currency.
EndTime Datetime When the Ad Set is scheduled to end.
StartTime Datetime When the Ad Set started.
UpdatedTime Datetime The time the Ad Set was last updated.
Recommendations String If there are recommendations for this ad set, this field includes them. Otherwise, this field will be null.
TargetingGenders Integer Indicates gender-based targeting. 0=all, 1=male, 2=female.
TargetingAgeMax Integer Maximum age. If used, must be 65 or lower.
TargetingAgeMin Integer Minimum age. If used, must be 13 or higher. If omitted, will default to 18.
TargetingCountries String Values for country targeting.
TargetingLocationTypes String Values for the types of locations to target.
TargetingRegions String The state, province, or region.
TargetingCities String Cities to target with a radius and distance.
TargetingZips String The zip codes used for targeting.
TargetingCustomLocations String Any custom locations to target.
TargetingGeoMarkets String They key for the market. The destination market areas (DMA) and keys are in the format DMA:NUMBER, such as DMA:501.
TargetingInterests String Interests to target based on.
TargetingBehaviors String Behaviors to target based on.
TargetingPageTypes String The types of pages to use when targeting. Values may include desktop, feed, desktopfeed, mobile, rightcolumn, rightcolumn-and-mobile, home, mobilefeed-and-external, desktop-and-mobile-and-external, feed-and-external, rightcolumn-and-mobile-and-external.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Albums

Query Albums associated with a Target. Accessing Album information typically requires the user_photos permission.

 

Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the album.
Target String The Id or username of the target you are retrieving albums from.
Name String The name of the album.
FromId String Id of the user who owns the album.
FromName String Name of the user who owns the album.
FromPicture String The picture of user the album is from.
FromCategory String The category of user the album is from. FromCategory may only be retrieved if the other From* fields are not selected.
Description String A description of the album.
Location String The location of the album.
Link String A link to this album on Facebook.
CoverPhoto String The album cover photo Id.
Privacy String The privacy settings for the album.
Count Integer The number of photos in this album.
Type String The type of the album: profile, mobile, wall, normal or album.
CommentsCount Integer The number of comments for the album.
LikesCount Integer The number of times the album has been liked.
LikesData String An aggregate of like data.
CommentsData String An aggregate of comment data.
SharedPostsData String An aggregate of shared post data.
CreatedTime Datetime When the album was uploaded.
UpdatedTime Datetime When the album was last updated.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Applications

Retrieve data about the Application specified by the Id.

 

Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the application.

The default value is 145634995501895.

Name String The name of the application.
Description String A description for the application.
Category String The category of the application.
Company String The company the application belongs to.
IconURL String A URL to the icon of the application.
Subcategory String The subcategory of the application.
Link String A link to the application on Facebook.
LogoURL String The URL of the application's logo.
DailyActiveUsers Integer The number of daily active users the application has.
DailyActiveUsersRank Integer Ranking comparing daily active users of this app vs. other apps.
WeeklyActiveUsers Integer The number of weekly active users the application has.
MonthlyActiveUsers Integer The number of monthly active users the application has.
MonthlyActiveUsersRank Integer Ranking comparing the monthly active users of this app vs. other apps.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

AuthorizedAdAccounts

Ad Accounts authorized to run ads for your business on a specified app. This view requires that you have at least one business configured for your user id.

 

Table Specific Information

 

AuthorizedAdAccounts in Facebook represent the ad accounts that have been authorized for advertising on the specified application for your Facebook business. You must have a business set up in Facebook for this view to work correctly.

 

Select

 

When querying AuthorizedAdAccounts, a Target must be specified and a business may optionally be specified. For instance:

SELECT * FROM AdAccounts WHERE Target = 'ApplicationId' AND Business = 'BusinessId'

 

If no business is specified, results for all of your available businesses will come back.

Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the Ad Account.
Target String The app id to request authorized ad accounts from.
AccountId String The Id of the Ad Account when viewed directly in Facebook.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
Business String The id of the business to retrieve authorized ad accounts for.
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Books

Query the Books a User is interested in. Accessing Book information typically requires the user_books permissions.

 

Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the page associated with the book.
Target String The Id or username of the user you are retrieving books from.
Name String The name of the book.
Picture String The URL to the picture of the book.
Category String The category of the book.
Description String The description of the book.
Likes Integer The number of people who like the book.
TalkingAbout Integer The number of people talking about the book.
Link String A link to the Facebook page for the book.
Website String A website associated with the book.
IsCommunityPage Boolean A boolean indicating if the page associated with the book is a community page.
IsPublished Boolean A boolean indicating if the page for the book is published.
CreatedTime Datetime When the book was added.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Campaigns

Query information about a Campaign or the Campaigns on a specific Ad Account. Accessing Campaign information requires the ads_read permission.

 

Table Specific Information

 

Campaigns in Facebook represent advertising campaigns that individual Ads or AdSets may be a part of.

 

Select

 

When querying campaigns, either the Id or Target must be used to filter results. The Target must be an ad account. For instance:

SELECT * FROM Campaigns WHERE Target = 'act_123456'
Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of Campaign.
Target String The target or Ad Account Id to get Campaigns.
Name String The name of the Campaign.
BuyingType String This field will help Facebook make future optimizations to delivery, pricing, and limits. All ad sets in this campaign must match the buying type.
ConfiguredStatus String If this status is PAUSED, all its active ad sets and ads will be paused and have an effective status CAMPAIGN_PAUSED. Prefer using 'status' instead of this.
EffectiveStatus String The effective status of this campaign. For example, when all Ad Sets beneath the campaign are paused, the effective status is ADSET_PAUSED..
Status String If this status is PAUSED, all its active ad sets and ads will be paused and have an effective status CAMPAIGN_PAUSED. The field returns the same value as 'configured_status', and is the suggested one to use.
CreatedTime Datetime When the campaign was created.
Objective String Objective of this ad campaign. If it is specified the API will validate that any ad groups created under the campaign match that objective.
SpendCap Double A spend cap for the campaign, such that it will not spend more than this cap. Expressed as integer value of the subunit in your currency.
StartTime Datetime When the Campaign was started.
StopTime Datetime When the Campaign was stopped.
UpdatedTime Datetime When the Campaign was last updated.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Events

Query the Events for a Target based on either the Target or SearchTerms. May require the user_events permission.

 

Table Specific Information

 

Events in Facebook are events created by a user or page that mark a specific date when something will take place. Events may be queried by Target, Id, or SearchTerms.

 

Select

 

When selecting events, a target may be specified. The target represents a user or page who has created events. By default, this will be the currently authenticated user. For example, to retrieve events associated with a user:

SELECT * FROM Events WHERE Target = 'UserId'

 

Alternatively, you can specify the SearchTerms to search all events on Facebook. For example:

SELECT * FROM Events WHERE SearchTerms = 'facebook'

 

If you know the event Id, you may also just specify the Id to obtain information about the specific event. For example:

SELECT * FROM Events WHERE Id = 'EventId'
Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the event.
Searchterms String The terms used to search the events if searching events.
Target String The Id or username of the target you are retrieving events for or are posting events to. This may be a page or a user.
Name String The name of the event.
StartTime Datetime The start time of the event.
EndTime Datetime The end time of the event.
Timezone String The time zone the event will take place in.
Description String The description of the event.
Picture String A URL to the picture of the event.
OwnerId String The Id of the user that created the event.
OwnerName String The name of the user that created the event.
OwnerPicture String Picture of the user who created the event.
OwnerCategory String Category of the owner, if available.
Location String The location of the event, if specified.
LocationId String The Id of the location for the event.
LocationStreet String The street address of the event.
LocationCity String The the city for the event.
LocationState String The the state for the event.
LocationCountry String The the country for the event.
LocationZip String The the ZIP code of the event.
LocationLatitude String The latitude of the event.
LocationLongitude String The longitude of the event.
TicketUri String A URL to a location to buy tickets for this event.
UpdatedTime Datetime When the event was last updated.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Friends

Query Friends of the authenticated User or Target User. Requires the user_friends permission. A Target may be specified to request Friend information for, but Friends may only be retrieved for the authenticated User or Friends of the authenticated User that use the same Facebook app.

 

Table Specific Information

 

Friends are users you have friended on Facebook. Only the user Id and name of the friend are returned. Other data may be looked up using Users.

Please be aware that for a friend to show up, they must have also installed the same App. For this reason, the view is not terribly useful outside of Facebook apps that are widely distributed.

Count can be selected from the table, which will give you the total number of friends regardless of if they have installed the same Facebook App. For instance:

SELECT Count(*) FROM Friends
Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the friend.
Target String The target you would like to get friends for. This may only be the authenticated user or friends of the authenticated user that also use the same Facebook app.
Name String The name of the friend.
Picture String Picture of the friend.
Birthday String The birthday of the friend.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Games

Query the Games a User is interested in. Accessing Game information may require the user_likes and user_interests permissions.

 

Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the page associated with the game.
Target String The Id or username of the user you are retrieving games from.
Name String The name of the game.
Picture String The URL to the picture of the game.
Category String The category of the game.
Description String The description of the game.
Likes Integer The number of people who like the game.
TalkingAbout Integer The number of people talking about the game.
Link String A link to the Facebook page for the game.
Website String A website associated with the game.
IsCommunityPage Boolean A boolean indicating if the page associated with the game is a community page.
IsPublished Boolean A boolean indicating if the page for the game is published.
CreatedTime Datetime When the game was added.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

GroupMemberships

Query the Groups based on the supplied GroupId. Groups may require the user_groups permission.

 

Table Specific Information

 

GroupMemberships in Facebook are the individual members of a given group. GroupMemberships are currently only exposed as a view.

 

Select

 

When selecting group memberships, a GroupID must be specified. For example, to retrieve the members of a group:

SELECT * FROM GroupMemberships WHERE GroupId = 'GroupId'
Columns

 

 

 

   
Name Type Description
GroupID [KEY] String The Id of the group. This must be specified to retrieve data.
UserID [KEY] String The Id of the user.
UserName String The name of the user.
IsAdmin Boolean A boolean indicating if the user is an admin.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
offset String Which result to begin returning results from. Used for manual paging of results.
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Groups

Query the Groups based on the supplied SearchTerms, Id, or Target. Groups may require the user_groups permission.

 

Table Specific Information

 

Groups in Facebook are groups of users created by users. Groups are currently only exposed as a view.

 

Select

 

When selecting groups, a target may be specified. The target represents a user or page in a group. By default, this will be the currently authenticated user. For example, to retrieve the groups a user belongs to:

SELECT * FROM Groups WHERE Target = 'UserId'

 

Alternatively, you can specify the SearchTerms to search all groups on Facebook. For example:

SELECT * FROM Groups WHERE SearchTerms = 'facebook'

 

If you know the group Id, you may also just specify the Id to obtain information about the specific group. For example:

SELECT * FROM Events WHERE Id = 'GroupId'
Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the group. Use either Id, or SearchTerms, or Target in the select query.
SearchTerms String The terms used to search for a group. Use either Id, or SearchTerms, or Target in the select query.
Target String The target to retrieve groups for. If a user or page id is specified here, the SELECT will retrieve groups the user is in. Use either Id, or SearchTerms, or Target in the select query.
Name String The name of the group.
Picture String The URL to the picture of the game.
Link String A link to the website for the group.
Description String A description of the group.
Email String An email account for the group.
OwnerId String The Id of the group owner.
OwnerName String The name of the group owner.
OwnerPicture String A URL to the picture of the group owner.
Icon String The URL for the group's icon.
CoverId String Id of the cover image for the group.
CoverSource String The URL to the cover image for the group.
CoverOffsetY String The y-axis offset of the cover image for the group.
CoverOffsetX String The x-axis offset of the cover image for the group.
VenueStreet String The street address of the group.
VenueCity String The the city for the group.
VenueState String The the state for the page.
VenueCountry String The the country for the group.
VenueZip String The ZIP code of the group.
VenueLatitude String The latitude of the group.
VenueLongitude String The longitude of the group.
Privacy String The privacy settings for the group.
UpdatedTime Datetime When the group was last updated.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
offset String Which result to begin returning results from. Used for manual paging of results.
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

InsightsByConsumptionType

Allows retrieval of insights by consumption type.

 

Table Specific Information

 

Insights by consumption type refers to any insights that can be retrieved from a page or post that measure how users consumed your content.

 

Select

 

When selecting insights, a Target must be specified. In addition, an InsightName and Period should always be specified. For instance:

SELECT * FROM InsightsByConsumptionType WHERE Target = 'mypostid' AND InsightName = 'PAGE_CONSUMPTIONS_BY_CONSUMPTION_TYPE' AND Period = 'day'

 

Additionally, StartTime and EndTime can be used to specify a range where insight data should be drawn from:

SELECT * FROM InsightsByConsumptionType WHERE Target = 'mypostid' AND InsightName = 'PAGE_CONSUMPTIONS_BY_CONSUMPTION_TYPE' AND Period = 'day' AND FromDateTime = '12/1/2015' AND ToDateTime = '12/31/2015'
Columns

 

 

 

   
Name Type Description
RowNumber [KEY] Int The row number of the result.
EndTime Datetime The most recent date this insight data is relevant for.
VideoPlay Integer Insight column indication the total for the stated consumption type.
OtherClicks Integer Insight column indication the total for the stated consumption type.
PhotoView Integer Insight column indication the total for the stated consumption type.
LinkClicks Integer Insight column indication the total for the stated consumption type.
ButtonClicks Integer Insight column indication the total for the stated consumption type.
Target String The target of the insight. This must always be specified.
InsightName String The name of the insight. This must always be specified. The available values are: PAGE_CONSUMPTIONS_BY_CONSUMPTION_TYPE,PAGE_CONSUMPTIONS_BY_CONSUMPTION_TYPE_UNIQUE,POST_CONSUMPTIONS_BY_TYPE,POST_CONSUMPTIONS_BY_TYPE_UNIQUE
Period String The period for the insight. This must always be specified.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
FromDateTime String The earliest time for insight data to have been collected.
ToDateTime String The latest time for insight data to have been collected.

 

 

 

InsightsByFeedbackType

Allows retrieval of insights by feedback type.

 

Table Specific Information

 

Insights by feedback type refers to any insights that can be retrieved from a page or post that measure what kind of feedback was left.

 

Select

 

When selecting insights, a Target must be specified. In addition, an InsightName and Period should always be specified. For instance:

SELECT * FROM InsightsByFeedbackType WHERE Target = 'mypostid' AND InsightName = 'PAGE_POSITIVE_FEEDBACK_BY_TYPE' AND Period = 'day'

 

Additionally, StartTime and EndTime can be used to specify a range where insight data should be drawn from:

SELECT * FROM InsightsByFeedbackType WHERE Target = 'mypostid' AND InsightName = 'PAGE_POSITIVE_FEEDBACK_BY_TYPE' AND Period = 'day' AND FromDateTime = '12/1/2015' AND ToDateTime = '12/31/2015'
Columns

 

 

 

   
Name Type Description
RowNumber [KEY] Int The row number of the result.
EndTime Date The most recent date this insight data is relevant for.
Like Integer Insight column indication the total for the positive feedback type.
Comment Integer Insight column indication the total for the positive feedback type.
Link Integer Insight column indication the total for the positive feedback type.
Answer Integer Insight column indication the total for the positive feedback type.
Claim Integer Insight column indication the total for the positive feedback type.
Rsvp Integer Insight column indication the total for the positive feedback type.
HideAllClicks Integer Insight column indication the total for the negative feedback type.
HideClicks Integer Insight column indication the total for the negative feedback type.
UnlikePageClicks Integer Insight column indication the total for the negative feedback type.
ReportSpamClicks Integer Insight column indication the total for the negative feedback type.
XButtonClicks Integer Insight column indication the total for the negative feedback type.
Target String The target of the insight. This must always be specified.
InsightName String The name of the insight. This must always be specified. The available values are: PAGE_NEGATIVE_FEEDBACK_BY_TYPE,PAGE_NEGATIVE_FEEDBACK_BY_TYPE_UNIQUE,PAGE_POSITIVE_FEEDBACK_BY_TYPE,PAGE_POSITIVE_FEEDBACK_BY_TYPE_UNIQUE,POST_NEGATIVE_FEEDBACK_BY_TYPE,POST_NEGATIVE_FEEDBACK_BY_TYPE_UNIQUE
Period String The period for the insight. This must always be specified.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
FromDateTime String The earliest time for insight data to have been collected.
ToDateTime String The latest time for insight data to have been collected.

 

 

 

InsightsByLikeSourceType

Allows retrieval of insights by like source type.

 

Columns

 

 

 

   
Name Type Description
RowNumber [KEY] Int The row number of the result.
EndTime Date The most recent date this insight data is relevant for.
PageSuggestion Integer Insight column indication the total for the like source type.
PageTimeline Integer Insight column indication the total for the like source type.
Ads Integer Insight column indication the total for the like source type.
MobileAds Integer Insight column indication the total for the like source type.
Registration Integer Insight column indication the total for the like source type.
Mobile Integer Insight column indication the total for the like source type.
WizardSuggestion Integer Insight column indication the total for the like source type.
ProfileConnect Integer Insight column indication the total for the like source type.
ExternalConnect Integer Insight column indication the total for the like source type.
RecommendedPages Integer Insight column indication the total for the like source type.
Favorites Integer Insight column indication the total for the like source type.
Api Integer Insight column indication the total for the like source type.
PageBrowser Integer Insight column indication the total for the like source type.
MobilePageBrowser Integer Insight column indication the total for the like source type.
Hovercard Integer Insight column indication the total for the like source type.
Search Integer Insight column indication the total for the like source type.
PageProfile Integer Insight column indication the total for the like source type.
Ticker Integer Insight column indication the total for the like source type.
LikeStory Integer Insight column indication the total for the like source type.
FeedChaining Integer Insight column indication the total for the like source type.
AllCategoryPyml Integer Insight column indication the total for the like source type.
PageSuggestionsOnLiking Integer Insight column indication the total for the like source type.
MobilePageSuggestionsOnLiking Integer Insight column indication the total for the like source type.
FanContextStory Integer Insight column indication the total for the like source type.
SponsoredStory Integer Insight column indication the total for the like source type.
PageInviteEscapeHatchFinch Integer Insight column indication the total for the like source type.
PageAdminNumPosts Integer Insight column indication the total for the like source type.
PageAdminNumPostsByType Integer Insight column indication the total for the like source type.
Target String The target of the insight. This must always be specified.
InsightName String The name of the insight. This must always be specified. The available values are: PAGE_FANS_BY_LIKE_SOURCE,PAGE_FANS_BY_LIKE_SOURCE_UNIQUE,PAGE_FANS_BY_UNLIKE_SOURCE_UNIQUE

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
FromDateTime String The earliest time for insight data to have been collected.
ToDateTime String The latest time for insight data to have been collected.

 

 

 

InsightsByPaidStatus

Allows retrieval of insights by paid status.

 

Table Specific Information

 

Insights by paid status refers to any insights that can be retrieved from a page or post that measure both paid and unpaid impressions.

 

Select

 

When selecting insights, a Target must be specified. In addition, an InsightName and Period should always be specified. For instance:

SELECT * FROM InsightsByFeedbackType WHERE Target = 'mypostid' AND InsightName = 'PAGE_IMPRESSIONS_BY_PAID_NON_PAID' AND Period = 'day'

 

Additionally, StartTime and EndTime can be used to specify a range where insight data should be drawn from:

SELECT * FROM InsightsByFeedbackType WHERE Target = 'mypostid' AND InsightName = 'PAGE_IMPRESSIONS_BY_PAID_NON_PAID' AND Period = 'day' AND FromDateTime = '12/1/2015' AND ToDateTime = '12/31/2015'
Columns

 

 

 

   
Name Type Description
RowNumber [KEY] Int The row number of the result.
EndTime Date The most recent date this insight data is relevant for.
Total Integer Insight column indication the total impressions.
Paid Integer Insight column indication the total paid impressions.
Unpaid Integer Insight column indication the total unpaid impressions.
Target String The target of the insight. This must always be specified.
InsightName String The name of the insight. This must always be specified. The available values are: PAGE_IMPRESSIONS_BY_PAID_NON_PAID,PAGE_IMPRESSIONS_BY_PAID_NON_PAID_UNIQUE,POST_IMPRESSIONS_BY_PAID_NON_PAID,POST_IMPRESSIONS_BY_PAID_NON_PAID_UNIQUE,PAGE_POSTS_IMPRESSIONS_BY_PAID_NON_PAID,PAGE_POSTS_IMPRESSIONS_BY_PAID_NON_PAID_UNIQUE
Period String The period for the insight. This must always be specified.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
FromDateTime String The earliest time for insight data to have been collected.
ToDateTime String The latest time for insight data to have been collected.

 

 

 

InsightsByReactionTotals

Allows retrieval of insights by like source type.

 

Table Specific Information

 

Insights by reaction total type refers to the reaction totals for your page or post.

 

Select

 

When selecting insights, a Target must be specified. This should be set to a page or post depending on the InsightName specified. You can set InsightName to 'PAGE_ACTIONS_POST_REACTIONS_TOTAL' or 'POST_REACTIONS_BY_TYPE_TOTAL', by default it will be 'PAGE_ACTIONS_POST_REACTIONS_TOTAL'. For instance:

SELECT * FROM InsightsByReactionTotals WHERE Target = 'mypageid' AND InsightName='PAGE_ACTIONS_POST_REACTIONS_TOTAL'

 

Additionally, StartTime and EndTime can be used to specify a range where insight data should be drawn from:

SELECT * FROM InsightsByReactionTotals WHERE Target = 'mypageid' AND InsightName='PAGE_ACTIONS_POST_REACTIONS_TOTAL' AND FromDateTime = '12/1/2015' AND ToDateTime = '12/31/2015'
Columns

 

 

 

   
Name Type Description
RowNumber [KEY] Int The row number of the result.
EndTime Date The most recent date this insight data is relevant for.
Like Integer Total like reactions.
Love Integer Total love reactions.
Wow Integer Total wow reactions.
Haha Integer Total haha reactions.
Sorry Integer Total sorry reactions.
Anger Integer Total anger reactions.
Target String The target of the insight. This must always be specified.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
FromDateTime String The earliest time for insight data to have been collected.
ToDateTime String The latest time for insight data to have been collected.
InsightName String Insight Name. The available values are: PAGE_ACTIONS_POST_REACTIONS_TOTAL,POST_REACTIONS_BY_TYPE_TOTAL

The default value is PAGE_ACTIONS_POST_REACTIONS_TOTAL.

 

 

 

InsightsByStoryType

Allows retrieval of insights by like story type.

 

Table Specific Information

 

Insights by story type refers to any insights that can be retrieved from a page or post that measure the types of stories that have occurred.

 

Select

 

When selecting insights, a Target must be specified. In addition, an InsightName and Period should always be specified. For instance:

SELECT * FROM InsightsByFeedbackType WHERE Target = 'mypostid' AND InsightName = 'PAGE_STORIES_BY_STORY_TYPE' AND Period = 'day'

 

Additionally, StartTime and EndTime can be used to specify a range where insight data should be drawn from:

SELECT * FROM InsightsByFeedbackType WHERE Target = 'mypostid' AND InsightName = 'PAGE_STORIES_BY_STORY_TYPE' AND Period = 'day' AND FromDateTime = '12/1/2015' AND ToDateTime = '12/31/2015'
Columns

 

 

 

   
Name Type Description
RowNumber [KEY] Int The row number of the result.
EndTime Date The most recent date this insight data is relevant for.
UserPost Integer Insight column indication the total for the stated story type.
PagePost Integer Insight column indication the total for the stated story type.
Checkin Integer Insight column indication the total for the stated story type.
Fan Integer Insight column indication the total for the stated story type.
Question Integer Insight column indication the total for the stated story type.
Coupon Integer Insight column indication the total for the stated story type.
Event Integer Insight column indication the total for the stated story type.
Mention Integer Insight column indication the total for the stated story type.
Other Integer Insight column indication the total for the stated story type.
Target String The target of the insight. This must always be specified.
InsightName String The name of the insight. This must always be specified. The available values are: PAGE_STORIES_BY_STORY_TYPE,PAGE_STORYTELLERS_BY_STORY_TYPE,PAGE_IMPRESSIONS_BY_STORY_TYPE,PAGE_IMPRESSIONS_BY_STORY_TYPE_UNIQUE,POST_IMPRESSIONS_BY_STORY_TYPE,POST_IMPRESSIONS_BY_STORY_TYPE_UNIQUE
Period String The period for the insight. This must always be specified.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
FromDateTime String The earliest time for insight data to have been collected.
ToDateTime String The latest time for insight data to have been collected.

 

 

 

InsightsByTabType

Allows retrieval of insights by tab type..

 

Table Specific Information

 

Insights by tab type refers to any insights that can be retrieved from a page or post that measure what tab was used to view your content.

 

Select

 

When selecting insights, a Target must be specified. In addition, an InsightName and Period should always be specified. For instance:

SELECT * FROM InsightsByFeedbackType WHERE Target = 'mypostid' AND InsightName = 'PAGE_TAB_VIEWS_LOGIN_TOP_UNIQUE' AND Period = 'day'

 

Additionally, StartTime and EndTime can be used to specify a range where insight data should be drawn from:

SELECT * FROM InsightsByFeedbackType WHERE Target = 'mypostid' AND InsightName = 'PAGE_TAB_VIEWS_LOGIN_TOP_UNIQUE' AND Period = 'day' AND FromDateTime = '12/1/2015' AND ToDateTime = '12/31/2015'
Columns

 

 

 

   
Name Type Description
RowNumber [KEY] Int The row number of the result.
EndTime Date The most recent date this insight data is relevant for.
AllActivity Integer Insight column indication the total for the tab type.
App Integer Insight column indication the total for the tab type.
Info Integer Insight column indication the total for the tab type.
Insights Integer Insight column indication the total for the tab type.
Likes Integer Insight column indication the total for the tab type.
Locations Integer Insight column indication the total for the tab type.
Photos Integer Insight column indication the total for the tab type.
PhotosAlbums Integer Insight column indication the total for the tab type.
PhotosStream Integer Insight column indication the total for the tab type.
Profile Integer Insight column indication the total for the tab type.
ProfileInfo Integer Insight column indication the total for the tab type.
ProfileLikes Integer Insight column indication the total for the tab type.
ProfilePhotos Integer Insight column indication the total for the tab type.
Timeline Integer Insight column indication the total for the tab type.
Events Integer Insight column indication the total for the tab type.
Videos Integer Insight column indication the total for the tab type.
Wall Integer Insight column indication the total for the tab type.
Target String The target of the insight. This must always be specified.
InsightName String The name of the insight. This must always be specified. The available values are: PAGE_TAB_VIEWS_LOGIN_TOP_UNIQUE,PAGE_TAB_VIEWS_LOGIN_TOP,PAGE_TAB_VIEWS_LOGOUT_TOP
Period String The period for the insight. This must always be specified.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
FromDateTime String The earliest time for insight data to have been collected.
ToDateTime String The latest time for insight data to have been collected.

 

 

 

LeadValues

Query information about a lead. Accessing Lead Information requires the ads_read permission.

 

Table Specific Information

 

LeadValues in Facebook represent individual values available from a Lead Ad. The types of values describing a leads are varied and can range from custom information such as a car model, or something general such as name and email.

 

Select

 

When querying lead values, either the Id or Target must be used to filter results. The id represents the id of the individual lead while the target must be a Lead Ad. For instance:

SELECT * FROM LeadValues WHERE Target = 'lead_ad_id'
 
SELECT * FROM LeadValues WHERE Id = 'lead_id'

 

Note that many values may come back for a single lead id. The leads themselves are a collection on the Lead Ad, and the lead values are a collection on each individual lead.

Columns

 

 

 

   
Name Type Description
ID String The Id of Lead.
Target String The target to retrieve leads from.
AdId String The id of the Ad the lead originates from.
AdName String The name of the Ad the lead originates from.
AdSetId String The id of the Ad Set the lead is associated with.
AdSetName String The name of the Ad Set the lead is associated with.
CampaignId String The id of the Campaign the lead is associated with.
CampaignName String The name of the Campaign the lead is associated with.
FormId String The id of the form the lead originates from.
FieldName String The name of the field of lead data.
FieldValues String The values for the given field of lead data.
IsOrganic Boolean A boolean indicating if the lead is organic.
CreatedTime Datetime The datetime the lead was created.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Movies

Query the Movies a User is interested in. Accessing Movie information requires the user_likes and user_interests permissions.

 

Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the page associated with the movie.
Target String The Id or username of the user you are retrieving the movie from.
Name String The name of the movie.
Picture String The URL to the picture of the movie.
Category String The category of the movie.
Description String The description of the movie.
Likes Integer The number of people who like the movie.
TalkingAbout Integer The number of people talking about the movie.
Link String A link to the Facebook page for the movie.
Website String A website associated with the movie.
IsCommunityPage Boolean A boolean indicating if the page associated with the movie is a community page.
IsPublished Boolean A boolean indicating if the page for the movie is published.
CreatedTime Datetime When the page for the movie was added.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Music

Query the Music a User is interested in. Accessing Music requires the user_likes and user_interests permissions.

 

Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the page associated with the music related entity.
Target String The Id or username of the user you are retrieving music from.
Name String The name of the page associated with the music related entity.
Picture String The URL to the picture of the music.
Category String The category of the music.
Description String The description of the music.
Likes Integer The number of people who like the music.
TalkingAbout Integer The number of people talking about the music.
Link String A link to the Facebook page for the music.
Website String A website associated with the music.
IsCommunityPage Boolean A boolean indicating if the page associated with the music is a community page.
IsPublished Boolean A boolean indicating if the page for the music is published.
CreatedTime Datetime When the page for the music was added.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Pages

Query the Pages based on the supplied SearchTerms or Id.

 

Table Specific Information

 

Pages in Facebook are pages that are created by a user and may be maintained by one or multiple users. Pages, like users, may be referred to by Id or by screen name.

 

Select

 

When querying pages, if nothing is specified then the pages you you administrate will be displayed by default. Otherwise, either the SearchTerms or the Id of the page can be specified. For example, to search Facebook for the term 'facebook':

SELECT * FROM Pages WHERE SearchTerms = 'facebook'

 

Alternatively, you can specify the Id or username of a page to retrieve a specific page. For example:

SELECT * FROM Pages WHERE Id = 'facebook'
Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the page.
SearchTerms String The terms used to search for a page.
Username String The username for the page, if any.
Name String The name of the page.
ParentID String Id of the parent page for this page.
Category String The category of the page.
Categories String An aggregate of categories associated with the page if multiple categories are available.
Link String A link to the page.
Picture String A link to the profile picture of the page for the page.
CoverId String Id of the cover image for the page.
CoverSource String The URL to the cover image for the page.
CoverOffsetY String The y-axis offset of the cover image for the page.
CoverOffsetX String The x-axis offset of the cover image for the page.
About String Basic information about the page.
Description String A description of the page, if available.
GeneralInfo String General information provided by the page.
LocationStreet String The street address of the page.
LocationCity String The city for the page.
LocationState String The state for the page.
LocationCountry String The country for the page.
LocationZip String The ZIP code of the page.
LocationLatitude String The latitude of the page.
LocationLongitude String The longitude of the page.
StoreNumber Integer Unique store number for this location page, if applicable.
Phone String The phone number of the page, if available.
Website String A link to the website for the page.
Likes Integer The number of people who like the page.
Checkins Integer The total number of users who have checked in to the place associated with the page.
TalkingAboutCount Integer The number of users talking about the page.
WereHereCount Integer The number of users who were at the location the page is for, if applicable.
CanPost Boolean Boolean indicating if the authenticated user can post of the page for the page.
IsPublished Boolean Boolean indicating if the page for the page has been published.
IsCommunityPage Boolean Boolean indicating if this is a community page.
PublicTransit String The public transit available for the page, if any.
ParkingStreet Boolean Boolean indicating if street parking is available.
ParkingLot Boolean Boolean indicating if a parking lot is available.
ParkingValet Boolean Boolean indicating if valet parking is available.
PromotionEligible Boolean Boosted posts eligibility status. Requires the manage_pages permission and you must be an administrator of the page.
PromotionIneligibleReason String Reason boosted posts are not eligible. Requires the manage_pages permission and you must be an administrator of the page.
CompanyOverview String The company overview. Applicable to companies.
Founded String When the company is founded. Applicable to companies.
Mission String The company mission. Applicable to companies.
Products String The products of this company. Applicable to companies.
Hours String An aggregate for the hours of operation. Applicable to businesses and places.
Attire String Dress code of the business. Applicable to restaurants or nightlife. Valid values are Casual, Dressy or Unspecified.
AcceptsCashOnly Boolean Whether the business accepts only cash as a payment option. Applicable to restaurants or nightlife.
AcceptsVisa Boolean Whether the business accepts Visa as a payment option. Applicable to restaurants or nightlife.
AcceptsAmericanExpress Boolean Whether the business accepts American Express as a payment option. Applicable to restaurants or nightlife.
AcceptsMasterCard Boolean Whether the business accepts MasterCard as a payment option. Applicable to restaurants or nightlife.
AcceptsDiscover Boolean Whether the business accepts Discover as a payment option. Applicable to restaurants or nightlife.
PriceRange String Price range of the business. Applicable to restaurants or nightlife. Valid values are \$ (0-10), \$\$ (10-30), \$\$\$ (30-50), \$\$\$\$ (50+), or Unspecified.
TakesReservations Boolean Whether the restaurant takes reservations. Only applicable to restaurants.
AllowsWalkins Boolean Whether the restaurant allows walk-ins. Only applicable to restaurants.
AllowsGroups Boolean Whether the restaurant accommodates groups. Only applicable to restaurants.
AllowsKids Boolean Whether the restaurant allows kids. Only applicable to restaurants.
ProvidesTakeout Boolean Whether the restaurant provides a takeout service. Only applicable to restaurants.
ProvidesDelivery Boolean Whether the restaurant provides a delivery service. Only applicable to restaurants.
ProvidesCatering Boolean Whether the restaurant provides a catering service. Only applicable to restaurants.
HasWaiters Boolean Whether the restaurant has waiters. Only applicable to restaurants.
HasOutdoorSeating Boolean Whether the restaurant has outdoor seating. Only applicable to restaurants.
ServesBreakfast Boolean Whether the restaurant serves breakfast. Only applicable to restaurants.
ServesLunch Boolean Whether the restaurant serves lunch. Only applicable to restaurants.
ServesDinner Boolean Whether the restaurant serves dinner. Only applicable to restaurants.
ServesCoffee Boolean Whether the restaurant serves coffee. Only applicable to restaurants.
ServesDrinks Boolean Whether the restaurant serves drinks. Only applicable to restaurants.
CulinaryTeam String Culinary team of the business. Applicable to restaurants or nightlife.
PharmaSafetyInfo String Pharmacy safety information. Applicable to pharmaceutical companies.
Affiliation String Affiliation of this person. Applicable to pages representing people.
Birthday String Birthday of this person. Applicable to pages representing people.
PersonalInfo String Personal information. Applicable to pages representing people.
PersonalInterests String Personal interests. Applicable to pages representing people.
ArtistsWeLike String Artists the band likes. Applicable to bands.
BandInterests String Band interests. Applicable to bands.
BandMembers String Members of the band. Applicable to bands.
Bio String Biography of the band. Applicable to bands.
BookingAgent String Booking agent of the band. Applicable to bands.
GeneralManager String General manager of the business. Applicable to restaurants or nightlife. Applicable to bands.
Hometown String Hometown of the band. Applicable to bands.
PressContact String Press contact information of the band. Applicable to bands.
RecordLabel String Record label of the band. Applicable to bands.
Awards String Awards information for the film or TV show. Applicable to films and TV shows.
DirectedBy String The director of the film or TV show. Applicable to films and TV shows.
Genre String The genre of the film or TV show. Applicable to films and TV shows.
Influences String Influences on the band. Applicable to bands.
PlotOutline String The plot outline of the film or TV show. Applicable to films and TV shows.
ProducedBy String The productor of the film. Applicable to films.
ReleaseData String The film's release data. Applicable to films and TV shows.
ScreenplayBy String The screenwriter of the film. Applicable to films and TV shows.
Starring String The cast of the film or TV show. Applicable to films and TV shows.
Studio String The studio for the film production. Applicable to films.
Network String The network the TV show airs on. Applicable to TV shows.
Schedule String The air schedule of the TV show. Applicable to TV shows.
Season String The current season of the TV show. Applicable to TV shows.
WrittenBy String The writer of the TV show. Applicable to TV shows.
Built String The information about when the vehicle was built. Applicable to vehicles.
Features String Features of the vehicle. Applicable to vehicles.
MPG String Miles per gallon for the vehicle. Applicable to vehicles.
Members String Members of this org. Applicable to pages representing team orgs.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
offset String Which result to begin returning results from. Used for manual paging of results.
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Permissions

Query the Permissions the User has granted the current application.

 

Columns

 

 

 

   
Name Type Description
PermissionName [KEY] String The name of the permission.
Status String The status of the requested permission.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Photos

Query Photos associated with a Target. Accessing Photo information typically requires the user_photos permission.

 

Table Specific Information

 

Photos in Facebook are photos that are uploaded by a user (for example, to a page) and are part of a photo album.

 

Select

 

When querying photos, specify a target. The target represents the user, page, album, or event that photos are being retrieved for. For example:

SELECT * FROM Photos WHERE Target = 'facebook'

 

If no target is specified, the currently authenticated user will be used as the target.

When querying photos, elements may be retrieved by specifying either the CreatedTime or the UpdatedTime. For example:

SELECT * FROM Photos WHERE Target='thesimpsons' AND CreatedTime >= '1/1/2012' AND CreatedTime <= '10/1/2012'
Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the photo.
Target String The Id or username of the target you are retrieving posts for or are posting to. This may be an album, event, page, or user.
FromId String Id of the user who uploaded the photo.
FromName String Name of the user who uploaded the photo.
FromPicture String Photo of the user who uploaded the photo.
FromCategory String Category of the user who uploaded the photo. FromCategory may only be retrieved if the other From* fields are not selected.
Link String A link to the photo on Facebook.
Name String The name of the photo.
Picture String A link a thumbnail of the photo.
Source String The source image of the photo.
Height Integer The height of the photo.
Width Integer The width of the photo.
Position Integer The position of the photo in the album.
Icon String A link to the icon Facebook displays when photos are published to the stream.
PlaceId String The Id of the location associated with the post, if any.
PlaceName String The name of the location associated with the post, if any.
Images String An aggregate of four different images for the photo.
CommentsCount Integer The number of comments for the photo.
LikesCount Integer The number of times the photo has been liked.
CommentsData String An aggregate of comments for this photo.
LikesData String An aggregate of likes data.
TagsData String An aggregate of objects describing the photo.
CreatedTime Datetime When the photo was uploaded.
UpdatedTime Datetime When the photo was last updated.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Places

Query the Places based on the supplied SearchTerms or Id. Places are stored as Pages in Facebook.

 

Table Specific Information

 

Places in Facebook are places that can charted on a map and visited. They will typically contain an address, coordinates, and basic information.

 

Select

 

When selecting places, SearchTerms may be specified. The SearchTerms represent a space-separated list of terms that may be used to search for places. For example:

SELECT * FROM Places WHERE SearchTerms = 'New York'

 

You may also search around the radius of a given latitude and longitude and specify the Distance in meters. For example:

SELECT * FROM Places WHERE SearchTerms='food' AND LocationLatitude='36.1215' AND LocationLongitude='-115.1739' AND Distance='10000'

 

If you know the place Id, you may also just specify the Id to obtain information about the specific place. For example:

SELECT * FROM Places WHERE Id = '203021866385217'
Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the place.
SearchTerms String The terms used to search for a place.
Username String Username for the page of the place if any.
Name String The name of the place.
Category String The category of the place.
Categories String An aggregate of categories associated with the page if multiple categories are available.
Link String A link to the place.
LocationStreet String The street address of the place.
LocationCity String The the city for the place.
LocationState String The the state for the place.
LocationCountry String The the country for the place.
LocationZip String The the ZIP code of the place.
LocationLatitude String The latitude of the place.
LocationLongitude String The longitude of the place.
Phone String The phone number of the place, if available.
Picture String A link to the profile picture of the page for the place.
About String Basic information about the place.
Description String A description of the place, if available.
Website String A link to the website for the place.
Likes Integer Number of people who like the place.
Checkins Integer The total number of users who have checked in to the place.
TalkingAboutCount Integer The number of users talking about the place.
CanPost Boolean Boolean indicating if the authenticated user can post of the page for the place.
IsPublished Boolean A boolean indicating if the page for the place has been published.
IsCommunityPage Boolean Boolean indicating if this is a community Page.
PublicTransit String The public transit available for the place, if any.
ParkingStreet Boolean Boolean indicating if street parking is available.
ParkingLot Boolean Boolean indicating if a parking lot is available.
ParkingValet Boolean Boolean indicating if valet parking is available.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
Distance String Optional input that can be specified if searching places. This is the maximum distance from the specified LocationLatitude and LocationLongitude in meters.
offset String Which result to begin returning results from. Used for manual paging of results.
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

ScheduledReportRuns

Query a list of the recently completed runs of a given Scheduled Report. Accessing Scheduled Report information requires the ads_read permission.

 

Table Specific Information

 

ScheduledReportRuns in Facebook represent individual executions of scheduled reports. Scheduled reports may be retrieved via AdScheduledReports.

 

Select

 

When querying scheduled report runs, the Target must be specified. The Target represents the scheduled report id obtained from AdScheduledReports. For instance:

SELECT * FROM ScheduledReportRuns WHERE Target = '123456'
Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of Scheduled Report.
Target String The Id of the scheduled report to retrieve completed runs for. This must be specified to retrieve scheduled report runs.
ScheduledReportId String The Id of the scheduled report to retrieve completed runs for.
PercentCompletion Double The percent of the report that has been completed for the run.
Status String The status of the report run.
DateStart Datetime The date the report run was started.
DateStop Datetime The date the report run was completed.
Emails String Who should be emailed when the report run is completed.
Name String The name of the report run.
IsBookmarked Boolean A boolean indicating if this report run is bookmarked.
IsRunning Boolean A boolean indicating if the rpot is still running.
TimeCompleted Time When the report finished running.
TimeRef String .

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

SimpleInsights

Allows the retrieval of simple insights with a single value in the response.

 

Table Specific Information

 

Simple insights refers to simple insights that can be retrieved from a page or post. These kinds of insights have a single value in the response and can only be filtered by a few values.

 

Select

 

When selecting simple insights, a Target must be specified. In addition, an InsightName and Period should always be specified. For instance:

SELECT * FROM SimpleInsights WHERE Target = 'mypageid' AND InsightName = 'PAGE_IMPRESSIONS' AND Period = 'day'

 

Additionally, StartTime and EndTime can be used to specify a range where insight data should be drawn from:

SELECT * FROM SimpleInsights WHERE Target = 'mypageid' AND InsightName = 'PAGE_IMPRESSIONS' AND Period = 'day' AND FromDateTime = '12/1/2015' AND ToDateTime = '12/31/2015'

 

Note: Please be aware that not all periods are available for all insights. Some will have day/week/days_28 available. Others may only have lifetime. It is best to check against Facebook to see what periods are and are not supported. They can be found here: https://developers.facebook.com/docs/graph-api/reference/insights

Columns

 

 

 

   
Name Type Description
RowNumber [KEY] Int The row number of the result.
EndTime Date The most recent date this insight data is relevant for.
Value Integer Insight column for a singular value response.
Target String The target of the insight. This must always be specified.
InsightName String The name of the insight. This must always be specified. The available values are: PAGE_ACTIONS_POST_REACTIONS_ANGER_TOTAL,PAGE_ACTIONS_POST_REACTIONS_HAHA_TOTAL,PAGE_ACTIONS_POST_REACTIONS_LIKE_TOTAL,PAGE_ACTIONS_POST_REACTIONS_LOVE_TOTAL,PAGE_ACTIONS_POST_REACTIONS_SORRY_TOTAL,PAGE_ACTIONS_POST_REACTIONS_WOW_TOTAL,PAGE_CONSUMPTIONS,PAGE_CONSUMPTIONS_UNIQUE,PAGE_ENGAGED_USERS,PAGE_FAN_ADDS,PAGE_FAN_ADDS_UNIQUE,PAGE_FAN_REMOVES,PAGE_FAN_REMOVES_UNIQUE,PAGE_FANS,PAGE_FANS_ONLINE,PAGE_FANS_ONLINE_PER_DAY,PAGE_IMPRESSIONS,PAGE_IMPRESSIONS_FREQUENCY_DISTRIBUTION,PAGE_IMPRESSIONS_ORGANIC,PAGE_IMPRESSIONS_ORGANIC_UNIQUE,PAGE_IMPRESSIONS_PAID,PAGE_IMPRESSIONS_PAID_UNIQUE,PAGE_IMPRESSIONS_UNIQUE,PAGE_IMPRESSIONS_VIRAL,PAGE_IMPRESSIONS_VIRAL_FREQUENCY_DISTRIBUTION,PAGE_IMPRESSIONS_VIRAL_UNIQUE,PAGE_NEGATIVE_FEEDBACK,PAGE_NEGATIVE_FEEDBACK_UNIQUE,PAGE_PLACES_CHECKIN_MOBILE,PAGE_PLACES_CHECKIN_MOBILE_UNIQUE,PAGE_PLACES_CHECKIN_TOTAL,PAGE_PLACES_CHECKIN_TOTAL_UNIQUE,PAGE_POSTS_IMPRESSIONS,PAGE_POSTS_IMPRESSIONS_ORGANIC,PAGE_POSTS_IMPRESSIONS_ORGANIC_UNIQUE,PAGE_POSTS_IMPRESSIONS_PAID,PAGE_POSTS_IMPRESSIONS_PAID_UNIQUE,PAGE_POSTS_IMPRESSIONS_UNIQUE,PAGE_POSTS_IMPRESSIONS_VIRAL,PAGE_POSTS_IMPRESSIONS_VIRAL_UNIQUE,PAGE_STORIES,PAGE_VIDEO_COMPLETE_VIEWS_30S,PAGE_VIDEO_COMPLETE_VIEWS_30S_AUTOPLAYED,PAGE_VIDEO_COMPLETE_VIEWS_30S_CLICK_TO_PLAY,PAGE_VIDEO_COMPLETE_VIEWS_30S_ORGANIC,PAGE_VIDEO_COMPLETE_VIEWS_30S_PAID,PAGE_VIDEO_COMPLETE_VIEWS_30S_REPEAT_VIEWS,PAGE_VIDEO_COMPLETE_VIEWS_30S_UNIQUE,PAGE_VIDEO_REPEAT_VIEWS,PAGE_VIDEO_VIEWS,PAGE_VIDEO_VIEWS_AUTOPLAYED,PAGE_VIDEO_VIEWS_CLICK_TO_PLAY,PAGE_VIDEO_VIEWS_ORGANIC,PAGE_VIDEO_VIEWS_PAID,PAGE_VIDEO_VIEWS_UNIQUE,PAGE_VIEWS,PAGE_VIEWS_LOGIN,PAGE_VIEWS_LOGIN_UNIQUE,PAGE_VIEWS_LOGOUT,PAGE_VIEWS_UNIQUE,POST_CONSUMPTIONS,POST_CONSUMPTIONS_UNIQUE,POST_ENGAGED_USERS,POST_IMPRESSIONS,POST_IMPRESSIONS_FAN,POST_IMPRESSIONS_FAN_PAID,POST_IMPRESSIONS_FAN_PAID_UNIQUE,POST_IMPRESSIONS_FAN_UNIQUE,POST_IMPRESSIONS_ORGANIC,POST_IMPRESSIONS_ORGANIC_UNIQUE,POST_IMPRESSIONS_PAID,POST_IMPRESSIONS_PAID_UNIQUE,POST_IMPRESSIONS_UNIQUE,POST_IMPRESSIONS_VIRAL,POST_IMPRESSIONS_VIRAL_UNIQUE,POST_NEGATIVE_FEEDBACK,POST_NEGATIVE_FEEDBACK_UNIQUE,POST_STORIES,POST_STORYTELLERS,POST_VIDEO_AVG_TIME_WATCHED,POST_VIDEO_COMPLETE_VIEWS_ORGANIC,POST_VIDEO_COMPLETE_VIEWS_ORGANIC_UNIQUE,POST_VIDEO_COMPLETE_VIEWS_PAID,POST_VIDEO_COMPLETE_VIEWS_PAID_UNIQUE,POST_VIDEO_LENGTH,POST_VIDEO_VIEW_TIME,POST_VIDEO_VIEW_TIME_ORGANIC,POST_VIDEO_VIEWS_10S,POST_VIDEO_VIEWS_10S_AUTOPLAYED,POST_VIDEO_VIEWS_10S_CLICKED_TO_PLAY,POST_VIDEO_VIEWS_10S_ORGANIC,POST_VIDEO_VIEWS_10S_PAID,POST_VIDEO_VIEWS_10S_SOUND_ON,POST_VIDEO_VIEWS_10S_UNIQUE,POST_VIDEO_VIEWS_ORGANIC,POST_VIDEO_VIEWS_ORGANIC_UNIQUE,POST_VIDEO_VIEWS_PAID,POST_VIDEO_VIEWS_PAID_UNIQUE,POST_VIDEO_VIEWS_SOUND_ON
Period String The period for the insight. This controls how rows will be broken up (by day, week, 28 days, or lifetime). This must always be specified.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
FromDateTime String The earliest time for insight data to have been collected.
ToDateTime String The latest time for insight data to have been collected.

 

 

 

SimpleVideoInsights

Allows the retrieval of simple video insights with a single value in the response.

 

Table Specific Information

 

Simple video insights refers to simple insights that can be retrieved from a video. These kinds of insights have a single value in the response and can only be filtered by a few values.

 

Select

 

When selecting simple video insights, a Target must be specified. In addition, an InsightName should always be specified. For instance:

SELECT * FROM SimpleVideoInsights WHERE Target = 'myvideoid' AND InsightName = 'TOTAL_VIDEO_VIEWS'

 

Note: Unlike other types of insights, video insights are only available for the entire lifetime of the video. Breakdowns in smaller units are not possible.

Columns

 

 

 

   
Name Type Description
RowNumber [KEY] Int The row number of the result.
Value Integer Insight column for a singular value response.
Target String The target of the insight. This must always be specified.
InsightName String The name of the insight. This must always be specified. The available values are: PAGE_VIDEO_VIEW_TIME,TOTAL_VIDEO_VIEWS,TOTAL_VIDEO_VIEWS_UNIQUE,TOTAL_VIDEO_VIEWS_AUTOPLAYED,TOTAL_VIDEO_VIEWS_CLICKED_TO_PLAY,TOTAL_VIDEO_VIEWS_SOUND_ON,TOTAL_VIDEO_COMPLETE_VIEWS,TOTAL_VIDEO_COMPLETE_VIEWS_UNIQUE,TOTAL_VIDEO_COMPLETE_VIEWS_AUTO_PLAYED,TOTAL_VIDEO_COMPLETE_VIEWS_CLICKED_TO_PLAY,TOTAL_VIDEO_10S_VIEWS,TOTAL_VIDEO_10S_VIEWS_UNIQUE,TOTAL_VIDEO_10S_VIEWS_auto_played,TOTAL_VIDEO_10S_VIEWS_CLICKED_TO_PLAY,TOTAL_VIDEO_10S_VIEWS_SOUND_ON,TOTAL_VIDEO_AVG_TIME_WATCHED,TOTAL_VIDEO_VIEW_TOTAL_TIME,TOTAL_VIDEO_IMPRESSIONS,TOTAL_VIDEO_IMPRESSIONS_UNIQUE,TOTAL_VIDEO_IMPRESSIONS_VIRAL_UNIQUE,TOTAL_VIDEO_IMPRESSIONS_VIRAL,TOTAL_VIDEO_IMPRESSIONS_FAN_UNIQUE,TOTAL_VIDEO_IMPRESSIONS_FAN

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
FromDateTime String The earliest time for insight data to have been collected.
ToDateTime String The latest time for insight data to have been collected.

 

 

 

TaggedBy

Query information about Posts, Statuses, Photos, and other entities that have tagged the User or Page. This view is a derivative of the Wall connection where only entries that have tagged the Target User or Page will be returned. In general it is only available for Pages.

 

Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the entity that has tagged the user or page.
Target String The Id or username of the user you are retrieving from.
Type String The type of post.
FromId String Id of the user who made the post.
FromName String Name of the user who made the post.
FromPicture String Picture of the user who made the post.
Message String The message of the post or status if available.
CommentsCount Integer The number of comments for the post.
LikesCount Integer The number of times the post has been liked.
SharesCount Integer The number of times the post has been shared.
CreatedTime Datetime When the post was created.
UpdatedTime Datetime When the post was last updated.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
offset String Which result to begin returning results from. Used for manual paging of results.
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Television

Query the TV shows a User is interested in. Accessing Television information may require the user_likes and user_interested permissions.

 

Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the page associated with the television.
Target String The Id or username of the user you are retrieving television information from.
Name String The name of the television.
Picture String The URL to the picture of the television.
Category String The category of the television.
Description String The description of the television.
Likes Integer The number of people who like the television.
TalkingAbout Integer The number of people talking about the television.
Link String A link to the facebook page for the television.
Website String A website associated with the television.
IsCommunityPage Boolean A boolean indicating if the page associated with the television is a community page.
IsPublished Boolean A boolean indicating if the page for the television is published.
CreatedTime Datetime When the television was added.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

VideoInsightsByActionType

Allows the retrieval of video insights by story action type.

 

Table Specific Information

 

Video insights by action type refers to video insights that can be retrieved that detail totals for types of stories.

 

Select

 

When selecting video insights, a Target must be specified.

SELECT * FROM VideoInsightsByActionType WHERE Target = 'myvideoid'

 

Note: Unlike other types of insights, video insights are only available for the entire lifetime of the video. Breakdowns in smaller units are not possible.

Columns

 

 

 

   
Name Type Description
RowNumber [KEY] Int The row number of the result.
Like Integer Total likes.
Comment Integer Total comments.
Share Integer Total shares.
Target String The target of the insight. This is a video and must always be specified.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
FromDateTime String The earliest time for insight data to have been collected.
ToDateTime String The latest time for insight data to have been collected.

 

 

 

VideoInsightsByDistributionType

Allows the retrieval of video insights by distribution type.

 

Table Specific Information

 

Video insights by reaction type refers to video insights that offer information on views your video got from different distribution sources.

 

Select

 

When selecting video insights, a Target must be specified. In addition, an InsightName should always be specified. For instance:

SELECT * FROM VideoInsightsByDistributionType WHERE Target = 'myvideoid' AND InsightName = 'TOTAL_VIDEO_VIEWS_BY_DISTRIBUTION_TYPE'

 

Note: Unlike other types of insights, video insights are only available for the entire lifetime of the video. Breakdowns in smaller units are not possible.

Columns

 

 

 

   
Name Type Description
RowNumber [KEY] Int The row number of the result.
Page_Owned Integer Views that were owned by the page.
Shared Integer Views coming from shares.
Crossposted Integer Views coming from posts that were crossposted.
Target String The target of the insight. This is a video and must always be specified.
InsightName String The name of the insight. This must always be specified. The available values are: TOTAL_VIDEO_VIEWS_BY_DISTRIBUTION_TYPE,TOTAL_VIDEO_VIEW_TIME_BY_DISTRIBUTION_TYPE

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
FromDateTime String The earliest time for insight data to have been collected.
ToDateTime String The latest time for insight data to have been collected.

 

 

 

VideoInsightsByReactionType

Allows the retrieval of video insights by reaction type.

 

Table Specific Information

 

Video insights by reaction type refers to video insights that can be measured by the type of reaction.

 

Select

 

When selecting video insights, a Target must be specified. For instance:

SELECT * FROM VideoInsightsByReactionType WHERE Target = 'myvideoid'

 

Note: Unlike other types of insights, video insights are only available for the entire lifetime of the video. Breakdowns in smaller units are not possible.

Columns

 

 

 

   
Name Type Description
RowNumber [KEY] Int The row number of the result.
Like Integer Total like reactions.
Love Integer Total love reactions.
Wow Integer Total wow reactions.
Haha Integer Total haha reactions.
Sorry Integer Total sorry reactions.
Anger Integer Total anger reactions.
Target String The target of the insight. This is a video and must always be specified.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
FromDateTime String The earliest time for insight data to have been collected.
ToDateTime String The latest time for insight data to have been collected.

 

 

 

Videos

Query Videos from a Target. Normally requires the user_videos permission.

 

Table Specific Information

 

Videos in Facebook are videos that have been uploaded by a user or to a page on Facebook.

 

Select

 

When selecting videos, specify a target. The target represents the user or page who uploaded the video. If no target is specified, the currently authenticated user will be used as the target. For example:

SELECT * FROM Videos WHERE Target = 'facebook'

 

If you know the Id, you can specify the Id to obtain information about the specific video. For example:

SELECT * FROM Videos WHERE Id = 'VideoId'

 

When querying videos, retrieve elements by specifying either the CreatedTime or the UpdatedTime. For example:

SELECT * FROM Videos WHERE Target='thesimpsons' AND CreatedTime >= '1/1/2012' AND CreatedTime <= '10/1/2012'
Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the video.
Target String The Id or username of the target you are retrieving videos for.
FromId String Id of the user who uploaded the video.
FromName String Name of the user who uploaded the video.
FromPicture String Picture of the user who uploaded the video.
FromCategory String Category of the user who uploaded the video. FromCategory may only be retrieved if the other From* fields are not selected.
Description String A description of the video.
Picture String URL for the thumbnail of the video.
Source String A URL to the raw, playable video file.
EmbedHtml String The HTML element that may be embedded in an Web page to play the video.
Icon String The icon that Facebook displays when videos are published to the Feed.
Format String An aggregate of four different formats for the video.
TagsData String An aggregate of users tagged in the video, if any.
CommentsCount Integer The number of comments for the video.
LikesCount Integer The number of times the video has been liked.
CommentsData String An aggregate of comments for the video.
CreatedTime Datetime When the video was uploaded.
UpdatedTime Datetime When the video was last updated.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.

 

 

 

Wall

Query Posts from the Wall of a Target.

 

Table Specific Information

 

Walls in Facebook are a collection of the various posts and updates made to a user's profile or wall.

 

Select

 

When selecting from a wall, specify a target. The target represents the user, page, group, application, or other valid entity that may have a wall associated with it. If no target is specified, the currently authenticated user will be used as the target. For example:

SELECT * FROM Wall WHERE Target = 'facebook'

 

When querying the wall, elements may be retrieved by specifying either the CreatedTime or the UpdatedTime. For example:

SELECT * FROM Wall WHERE Target='facebook' AND CreatedTime >= '1/1/2012' AND CreatedTime <= '2/1/2012'

 

Columns

 

 

 

   
Name Type Description
ID [KEY] String The Id of the post.
Target String The Id or username of the target you are retrieving the wall for.
Type String The type of post.
FromId String Id of the user who made the post.
FromName String Name of the user who made the post.
FromPicture String Picture of the user who made the comment.
FromCategory String Category of the user who made the post. FromCategory may only be retrieved if the other From* fields are not selected.
ToData String An aggregate of users the post was made to.
Message String The message of the post.
MessageTags String An aggregate of objects tagged in the message such as Users, Pages, etc.
Link String The link attached to the post.
Name String The name of the link.
Caption String The caption of the link, which appears beneath the link name.
Description String A description of the link (appears beneath the link caption).
Picture String A link to the picture included in the post.
Source String A URL to a flash movie or video file embedded within the post.
Icon String Link to an icon representing the type of post.
Actions String An aggregate of available actions on the post (such as commenting or liking).
CommentsCount Integer The number of comments for the post.
LikesCount Integer The number of times the post has been liked.
SharesCount Integer The number of times the post has been shared.
PlaceId String The Id of the location associated with the post, if any.
PlaceName String The name of the location associated with the post, if any.
ObjectId String The Facebook object Id for an uploaded photo or video.
ApplicationId String Id of the application this post came from.
ApplicationName String Name of the application this post came from.
ApplicationCanvasName String Information about the application used to create the entity.
ApplicationNamespace String Information about the application used to create the entity.
Story String Text of stories not intentionally generated by users, such as those generated when two users become friends; you must have the 'Include recent activity stories' migration enabled in your app to retrieve these stories.
StoryTags String An aggregate of objects (users, pages, etc.) associated with the story.
LikesData String An aggregate of like data.
CommentsData String An aggregate of comments for this post.
WithTagsData String Objects (users, pages, etc.) tagged as being with the publisher of the post.
CreatedTime Datetime When the post was created.
UpdatedTime Datetime When the post was last updated.

 

Pseudo-Columns

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

 

 

   
Name Type Description
rows@next String This is used to page through multiple pages of results and should not be set manually.