Pages.getInfo
From Facebook Developer Wiki
Contents |
Description
Returns all visible Facebook Pages to the filters specified. This may be used to find all Pages of which a user is a fan, or to query specific Page IDs. The session_key parameter is optional.
- When the
session_keyparameter is not passed, you can get public information, or information about public pages. Theuidparameter is not even considered. - When the
session_keyparameter is passed, you can get information the application user is authorized to see, and information about pages that have added the application.
Parameters
| Required | Name | Type | Description | |
| required | api_key | string | The application key associated with the calling application. If you specify the API key in your client, you don't need to pass it with every call. | |
|---|---|---|---|---|
| call_id | float | The request's sequence number. Each successive call for any session must use a sequence number greater than the last. We suggest using the current time in milliseconds, such as PHP's microtime(true) function. If you specify the call ID in your client, you don't need to pass it with every call. | ||
| v | string | This must be set to 1.0 to use this version of the API. If you specify the version in your client, you don't need to pass it with every call. | ||
| fields | string | List of desired fields to return. This is a comma-separated list of field strings and is described below. | ||
| optional | session_key | string | The session key of the logged in user, or the session key provided when the user granted your application the offline_access extended permission. The session key is automatically included by our PHP client. If you make this call without a session, it returns only those Pages the user has fanned that would be visible to a logged-out user. | |
| format | string | The desired response format, which can be either XML or JSON. (Default value is XML.) | ||
| callback | string | Wrap the response inside a function call. This is primarily to enable cross-domain javascript requests using the <script> tag, sometimes known as "JSONP". This works with both XML and JSON. | ||
| page_ids | string | List of page IDs. This is a comma-separated list of page IDs. | ||
| uid | int | The ID of the user. Defaults to the logged in user if the session_key is valid, and no page_ids are passed. Used to get the pages a given user is a fan of. | ||
| required | sig | string | An MD5 hash of the current request and your secret key, as described in the How Facebook Authenticates Your Application. Facebook computes the signature for you automatically. |
Response
The Page info elements returned are those visible to Facebook Platform. Following is a list of arguments and the elements they return (for the complete list, see the page FQL table):
- page_id - The ID corresponding to the page returned. This is always returned (whether included in fields or not, and always as the first subelement.
- name - Page entered profile field. May not be blank.
- page_url - Page URL. May not be blank.
- pic_small - URL of profile picture, with max width 50px and max height 150px. May be blank.
- pic_square URL of a square section of the profile picture, with width 50px and height 50px. May be blank.
- pic_big - URL of profile picture with max width 200px and max height 600px. May be blank.
- pic - URL of profile picture with max width 100px and max height 300px. May be blank.
- pic_large - URL of profile picture with max width 396px and max height 1188px. May be blank.
- type - Contains the type of the page.
- website - Contains the website of the page.
- location - Contains the location of the entity. Applies to Local Businesses. Contains five children: street, city, state, country, zip . Notes on each othe children: street may be blank; city may be blank; state is a well-defined two-letter American state or Canadian province abbreviation, and may be blank; country is well-defined, and may be blank; zip is an integer, and is 0 if unspecified.
- hours - Contains the operating hours. Each local business will be allowed to specify up to two sets of operating hours per day. Contains the following children, mon_1_open, mon_1_close, tue_1_open, tue_1_close, wed_1_open, wed_1_close, thu_1_open, thu_1_close, fri_1_open, fri_1_close, sat_1_open, sat_1_close, sun_1_open, sun_1_close, mon_2_open, mon_2_close, tue_2_open, tue_2_close, wed_2_open, wed_2_close, thu_2_open, thu_2_close, fri_2_open, fri_2_close, sat_2_open, sat_2_close, sun_2_open, sun_2_close. Notes on the children:
- Each field is returned with time (in seconds since epoch). For example, 9:00 AM is represented as 406800
- band_members - Members of the band, may be blank.
- bio - biography field, may be blank.
- hometown - hometown field, may be blank.
- genre - genre of music. Contains the following children: dance, party, relax, talk, think, workout, sing, intimate, raunchy, headphones . Notes on the children:
- Zero or more of them may be set
- May be 1 or 0.
- record_label - record label, may be blank
- influences - influences, may be blank
- has_added_app - Bool (0 or 1) indicating whether the page has added the calling application to their Facebook account.
- founded - When company was founded, may be blank
- company_overview - overview of company, may be blank
- mission - Mission of company, may be blank
- products - Company's products, may be blank
- release_date - Release date of film, may be blank
- starring - Who's starring in TV/Film, may be blank
- written_by - Who wrote TV/Film, may be blank
- directed_by - Who directed TV/Film, may be blank
- produced_by - Who produced TV/Film, may be blank
- studio - Studio Film was produced, may be blank
- awards - Awards received by TV/Film, may be blank
- plot_outline - Plot outline of TV/Film, may be blank
- network - Network of TV show, may be blank
- season - Season of TV show, may be blank
- schedule - Schedule of TV show, may be blank
- fan_count - The number of users who are fans or supporters of this Page. This field may be blank.
Example Return XML
FQL Equivalent
FQL queries take the form: SELECT <fields> FROM <table> WHERE <conditions>
This function is similar (but returning in a slightly different format) to doing the following FQL query, with the appropriate parameters filled in:
Error Codes
For a complete list of error codes, see Error codes.
| Code | Description | |
| 1 | An unknown error occurred. Please resubmit the request. | |
|---|---|---|
| 2 | The service is not available at this time. | |
| 4 | The application has reached the maximum number of requests allowed. More requests are allowed once the time window has completed. | |
| 5 | The request came from a remote address not allowed by this application. | |
| 100 | One of the parameters specified was missing or invalid. | |
| 101 | The API key submitted is not associated with any known application. | |
| 102 | The session key was improperly submitted or has reached its timeout. Direct the user to log in again to obtain another key. | |
| 103 | The submitted call_id was not greater than the previous call_id for this session. | |
| 104 | Incorrect signature. |
Notes
You can call this method using a session secret, and not the application secret (for example, for a Facebook Connect site or desktop application).
