Ping

Simple Usage

This endpoint returns a parameter named "ping" that contains the word "Pong It is intended for external uptime monitoring but you can also use it if you want to.

index.js
await JokeClient.ping();

Parameters

Parameters supported on this method

format

  • Type: String
  • Default: json
  • Options: json, xml, yaml and txt

Response Formats (or just "Formats") are a way to get your data in a different file format. Maybe your environment or language doesn't support JSON natively. In that case, JokeAPI is able to convert the JSON-formatted joke to a different format for you.

index.js
await JokeClient.ping({
  format: 'xml'
})

lang

  • Type: String
  • Default: Undefined
  • Supported system languages: cs, de, en, it and ru
  • Supported joke languages: cs, de, en, es, fr and pt

This parameter can be used on every endpoint, but it is possible that no translations or jokes exist yet for your language.

index.js
await JokeClient.ping({
  lang: 'en'
})
Edit this page on GitHub Updated at Fri, Dec 10, 2021