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

226
Views
Next js API get DOCX url and return words count

I have a Nextjs React app. Client will send a docx external url to to next api, and expect to get the words count inside the docx. Client can also do the work itself.

Another solution is to return a blob, and client will do the count.

Haven't found any solution for that yet.

Client using next js api:

const docxURL = encodeURIComponent('some_external_url.docx')
const result = await fetch(`/api/words/${docxURL}`, {method: 'GET'})
const wordsCount = (await result.json()).count

Pure Client:

const docxURL = 'some_external_url.docx'
const result = await fetch(docxURL, {method: 'GET', mode: 'no-cors'})
const wordsCount = ...?
about 4 years ago · Juan Pablo Isaza
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!