'Build an Authenticated GET API in R

I can't figure out how to set up an API correctly. I have an example in Python and would like to understand how to reproduce it with R, how to correctly choose attributes and authenticate.

  import requests
  import json

      url = "https://developer.junglescout.com/api/product_database_query?marketplace=us"

      payload = json.dumps({
        "data": {
          "type": "product_database_query",
          "attributes": {
            "include_keywords": [
              "videogames"
            ],
            "categories": [
              "Video Games"
            ],
            "exclude_unavailable_products": True
          }
        }
      })
      headers = {
        'Content-Type': 'application/vnd.api+json',
        'Accept': 'application/vnd.junglescout.v1+json',
        'Authorization': 'KEY_NAME:MY_API_KEY'
      }

      response = requests.request("POST", url, headers=headers, data=payload)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source