Accessing Jibber AI (Rapid API) using PowerShell

To access RapidAPI from PowerShell, you can use the Invoke-RestMethod command in combination with your RapidAPI key.

Here are the basic steps to get you started:

  • Ensure you have signed up for a RapidAPI account and subscribed to the Jibber AI API. You will receive an API key that you will need to use to authenticate your requests
  • Once you have your API key, you can make requests to the API endpoint

Here's an example using Invoke-RestMethod:

PowerShell
Function Analyze-Text-RapidAPI([string]$Text)
{
	$headers=@{}
	$headers.Add("x-rapidapi-host", "jibber-analyzer.p.rapidapi.com")
	$headers.Add("x-rapidapi-key", "your-rapid-api-key")
	$body = @"
	{
	  "features": {
		  "sentiment": true,
			"keyword": true,
			"summary": true,
			"entities": true,
			"pii": true
	  },
	  "text": "$Text"
	}
	"@
	$response = Invoke-RestMethod -Uri 'https://jibber-analyzer.p.rapidapi.com/en/analyze' -Method POST -Headers $headers -Body $body -ContentType "application/json"
	return $response
}

$result = Analyze-Text-RapidAPI "My name is Julia Peach and I live in Paris."
Write-Output($result.entity)

In the above example, replace your-rapid-api-key with your RapidAPI key.

For other languages, change the /en/ in the Uri to the language of choice: