In an effort to improve developer experience we are introducing Graph API Explorer v2.0 (BETA). This new, full screen version allows you to:
The Graph API Explorer is a tool that allows you to construct and perform Graph API queries and see their responses, for any apps on which you have an admin, developer, or tester role.
The tool is extremely useful during app development because it inherits all of your app's settings, including approved login permissions, features, and settings for any products you may have added. This allows you to quickly and easily perform Graph API queries that respect your app's settings. You can also use the tool to quickly generate access tokens, build and test complex queries, export query code samples, save queries, and generate debug information to include in support requests.
In order to use the Graph API Explorer, you must be signed into your Facebook developer account and have an admin, developer, or tester role on at least one app.
The Graph API Explorer has the following components.
The Graph API Explorer App was deprecated on July 2nd, 2018, and removed from the Graph API Explorer's Application dropdown menu. You can no longer use the Graph API Explorer App with the Graph API Explorer. Instead, you must use an app on which you have an admin, developer, or tester role.
The Application dropdown menu displays all the apps on which you have an admin, developer, or tester role. Use the dropdown to select the app that you wish to test.
The Get Token dropdown menu allows you to get and exchange App, User, and Page access tokens for the currently selected app. You can also use it to uninstall your app from your User node, which destroys the current access token.
Whenever you request a User access token, a custom Facebook Login window will appear that lists every possible login permission. This allows the current app User (which will be you) to grant the app specific permissions. Typically you will only grant permissions that your app actually needs.
If your app is in development mode, you can grant your app any permission and your queries will respect them. If your app is live, however, granting a permission that your app has not been approved for by the App Review process will cause your query to fail whenever you submit it.
When you get an access token it will be displayed here. This is the token that will be included in your Graph API query.
You can click the information icon to see information about the current token, including the app that it's tied to, and any login permissions that have been granted by the User who is using the app (which will be you).
The current query appears here. You can edit the current query by typing in a new one, or by searching for and selecting fields in the field viewer after executing the query. You can also use the dropdown menus to switch between operation methods, and target different versions of the Graph API.
If you click the star icon at the end of the field, the query will be saved as a favorite. You can view your favorite queries by clicking the book icon.
When you submit a
GET query on a node, the field viewer will display the name of the node and the fields returned by the Graph API. You can modify your query by searching for and selecting new fields, clicking the plus icon and choosing from available fields, or unchecking unnecessary fields. These actions will dynamically update your query in the query string field.
The response to your last submitted query will appear here.
If you are happy with your query, click the Get Code button to generate sample code based on the query. Typically you won't be able to copy and paste the sample code directly in your code base, but it will give you a useful starting point.
If your query keeps failing and you can't figure out why, and you decide to contact Developer Support, click this button to copy your query and response details to your clipboard. You can submit this with your support request to help us figure out what's going on.
Click the Save Session button to save the state of your query, with the access token removed. You an include the link to this session if you decide to contact Developer Support.
Try executing the default query that appears when you first load the Graph API Explorer. If you haven't already, open the Graph API Explorer in a new window, select the app you want to test from the application dropdown menu, and get a User access token.
The default query should appear in the query string field:
The default query is requesting the
name fields on the
/me node, which is a special node that maps to either the
/Page node identified by the token. Since your are using a User access token, this maps to your User node.
name fields are publicly available and can be returned if the User has granted your app the
public_profile permissions. These permissions are pre-approved for all apps (you can confirm this by clicking the information icon in the Access Token Field), so you don't have grant your app any additional permissions for the query to work. So, just click Get Access Token in the Login Permission Selector and confirm that you want to grant your app access to your publicly available User information.
Submit your query, and you should see your app-scoped User ID and name appear in the response window.