Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
How can I pull data from an API into a Discord Embed Message?

I am trying to pull data from an API using GET to display that information in a nice Discord Embed message that updated frequently. How can I use the information it gives me and display it in a discord embed?

Also, how can I make it so that an ID is instead shown as a Name instead of the ID itself?

The APIs I want to use are all here in this repo https://github.com/ToontownRewritten/api-doc

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Just use node-fetch or JavaScript fetch() function

Here is an example (this is a very simplified example and probably will need big adjustments to work properly with your API, as an API requires authentication and no headers were mentioned on this fetch request):

fetch('url')
  .then((response) => {
    return response.json()
  })
  .then((data) => {
    console.log(data)
    const embed = new Discord.MessageEmbed()
    .setTitle('hi')
    .setDescription(data)
    message.channel.send(embed)
  })
  .catch((err) => {
    // Do something for an error here
  })

You change this to your needs, but just to give you a general idea.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!