Searchmetrics Developers API

Getting started

Structure of an API request

GraphQL requests are HTTP POST request, unlike a traditional REST API, you have a single entry point:

https://graphql.searchmetrics.com

To be authorized to use our API, you will need to add your API Key and API Secret in the respective http headers “sm-api-key” and “sm-api-secret”:

"sm-api-key": "$yourShineyKey",
"sm-api-secret": "$yourDarkestSecret"

Queries body looks like

{
  "query": "{
              greeting {
                randomId
                who
              }
            }"
}


Forming queries

curl

Check that your API Key is working with our hello world query:

curl \
-H "sm-api-key: $yourShineyKey" \
-H "sm-api-secret: $yourDarkestSecret" \
-d '{ "query": "{ greeting { randomId who } }" }'\
https://graphql.searchmetrics.com/


GraphiQL

Head out to our GraphiQL

https://graphql.searchmetrics.com/graphiql

Enter your API Key ($yourShinyKey) and API Secret ($yourDarkestSecret) in the input boxes

Then you can start writing queries there such as our Hello World query:

query {
  greeting {
    randomId
    who
  }
}


Examples

Do not forget to enter your API Key ($yourShinyKey) and API Secret ($yourDarkestSecret) in the input boxes!

example query

example mutation


Queries with code

Check our examples to make queries programmatically