GraphQL at Indeed
To use Indeed's GraphQL APIs, you must provide certain information to authorize your API calls.
Before following this document, ask Indeed to register your 2-legged OAuth app.
Get a 2-legged OAuth token
To call Indeed's APIs, you must get tokens to authorize your API calls.
You can get tokens in the command line using a tool like curl, or using UI in a tool like Insomnia.
Using curl
To request an access token using curl, see Get or refresh 2-legged access token.
Make sure that you don't expose the client secret to end users. As such, it's recommended that you generate tokens in the backend. OAuth 2.0 libraries are available in most backend languages, such as Spring Security OAuth Client for Java/Kotlin.
Using Insomnia
You can configure Insomnia to request and use a 2-legged OAuth token when making an API call. For details, see Send Your First Request in the Insomnia documentation.
Call an Indeed API
When calling an Indeed GraphQL API, you must include certain information to authorize the call. You can use a command-line tool like curl or a UI tool like Insomnia to make the call.
For more information about Insomnia, see the Insomnia documentation.
When you call the Indeed PLUS APIs, initiate a timeout after 5,000 milliseconds.
Endpoint
The endpoint for Indeed's GraphQL APIs is: https://apis.indeed.com/graphql
Method
To call an Indeed GraphQL API, use the POST
method.
Headers
The following headers are required when calling an Indeed GraphQL API:
Content type
Content-Type: application/json
Authorization
Authorization: Bearer <access-token>
Remember to replace <access-token>
with your own access token.
To request an access token, see Get a 2-legged OAuth token.
Rate limiting
indeed-client-id: <client-id>
Remember to replace <client-id>
with your own client ID.
To get your client ID, see Set up your app.
Using curl
The following curl command shows how to call an Indeed GraphQL API:
curl --request POST \ --url 'https://apis.indeed.com/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <access-token>' \ --header 'indeed-client-id: <client-id>' \ --data '<operation>'
Note that all calls are made as POST
requests to the following endpoint: https://apis.indeed.com/graphql
In addition, all calls must contain the Content-Type: application/json
, Authorization: Bearer <access-token>
, and indeed-client-id: <client-id>
headers. Remember to replace <access-token>
with your own token and <client-id>
with your own client ID.
Replace <operation>
with your own GraphQL operation. You can find sample mutations in the Create an example employer and Create an example job tutorials.
Using Insomnia
See Send Your First Request in the Insomnia documentation.
Response
When the server runs a GraphQL operation successfully, even if call-specific errors occur, the Indeed GraphQL APIs return the HTTP 200 OK
status code.
As such, it's recommended to look for errors in the response.
Success
The following example calls patchEmployer
with a variable $input
as its input
parameter:
mutation PatchEmployer($input: PatchEmployerInput!) { patchEmployer(input: $input) { attributeUpdated }}
Responses to Indeed PLUS GraphQL API calls follow the GraphQL specification. They include a data
field containing the data from the API, and an errors
field if there are any errors.
The following is an example of a successful response to the previous call. Since the example asked for attributeUpdated
, the field is provided in data
:
{ "data": { "patchEmployer": { "attributeUpdated": true } }}
Error
Responses to Indeed PLUS GraphQL API calls follow the GraphQL specification. They include a data
field containing the data from the API, and an errors
field if there are any errors.
For information about troubleshooting errors, See Troubleshoot GraphQL errors.
Indeed-specific GraphQL
Indeed maintains its own GraphQL schema that defines unique types and operations.
Schema
To download Indeed's GraphQL schema, see GraphQL schema.
Types
In addition to the standard scalar types, Indeed defines its own. A few examples are:
Scalar type | Format | Example |
---|---|---|
CountryCode | ISO-3166-1 | JP |
LanguageCode | ISO-639-1 | ja |
CurrencyCode | ISO-4217 | JPY |
DateTime | RFC-3339 | 2006-04-13T14:12:53.4242+05:30 |
EmailAddress | RFC-822 | foo@bar.com |
Int64 | 64-bit signed integer | 123456789 |
PhoneNumber | E.164 | +12024561111 |
WebUrl | RFC-2396/2732 | http://www.foo.com/bar |
Next steps
To troubleshoot OAuth errors that can occur before you access GraphQL, see Troubleshoot OAuth errors.
To troubleshoot GraphQL errors, See Troubleshoot GraphQL errors.
For examples of how to use the APIs, see Create an example employer and Create an example job.
For complete documentation of the Indeed GraphQL APIs, see the GraphQL API reference.