Support Log in
All Features: Translate WordPress with AI

REST API for Headless Multilingual WordPress

If you’re building a headless WordPress site — React, Next.js, Nuxt, SvelteKit, Astro, or any other JavaScript frontend — you need to fetch translated content from WordPress over HTTP. Lang Forge exposes a REST API so you can.


The endpoints

All endpoints live under /wp-json/langforge/v1/ and follow standard WordPress REST API conventions — HTTP methods, status codes, and authentication via WordPress’s existing auth mechanisms (cookies for logged-in users, application passwords for API keys, OAuth for third-party apps).

Languages

  • GET /languages: list the active languages with their code, name, locale, and URL

Translations

  • GET /translations/<post_id>: list the translations of a post, with the ID, title, status, and permalink of each
  • POST /translations: link two existing posts as translations of each other (post_id, target_post_id, language)
  • DELETE /translations/<post_id>/<lang>: remove the link to the translation in that language (the translated post itself is kept)

Translation status

  • GET /translation-status: how many posts are translated in each language, for one post type (post_type, default post)

Glossary

  • GET /glossary: list glossary terms (filter with from, to, and search)
  • POST /glossary: add a term
  • PUT /glossary/<id>: update a term
  • DELETE /glossary/<id>: delete a term
  • POST /glossary/check: check a text against the glossary for a language pair
  • POST /glossary/import: import terms from CSV text

Translation memory (Pro)

  • GET /tm/suggest: get translation memory suggestions for a text (text, from, to)
  • GET /tm: list the entries page by page, with search
  • GET /tm/entries: list the entries for a language pair
  • PUT /tm/<id>: update the translated text of an entry
  • DELETE /tm/<id>: delete an entry
  • POST /tm/populate: fill the memory from existing translations
  • POST /tm/import-tmx: import a TMX file
  • GET /tm/export-tmx: export the memory as a TMX file

Analytics (Pro)

  • GET /analytics: translation analytics for a period (period, default 30d)

Language fields on posts

The standard WordPress endpoints for posts and pages also carry two extra fields: langforge_language, the language of the post (you can set it in a write request), and langforge_translations, read only, a map from language code to the ID of the translation.


Authentication

The REST API uses WordPress’s native authentication. For headless frontends, the recommended approach is application passwords (a built-in WordPress feature since 5.6) or JWT via a third-party plugin. Lang Forge doesn’t introduce its own auth layer — it respects whatever you already have.

Every endpoint requires authentication. Languages, translations, glossary checks, and translation memory suggestions need the edit_posts capability, and the translation endpoints also check that you can edit the posts involved. Translation status, the rest of the glossary and translation memory endpoints, and analytics need manage_options.


Use cases

Headless WordPress sites

Fetch translated content into a React or Next.js frontend. Lang Forge returns the same shape as the WordPress core REST API, with additional language metadata on every post.

Mobile apps

Consume translated content in a native mobile app via the REST API. Users see the app in their preferred language, served by WordPress on the backend.

Third-party integrations

A Zapier, Make, or n8n workflow that fetches a translated post on demand — for sending out newsletters, syndicating to social media, or piping content into a separate CMS.

Custom admin tools

Build an admin dashboard in Retool, Budibase, or your own tool that talks to Lang Forge directly. Useful for agencies managing multilingual content across dozens of client sites.

CI/CD automation

Nightly build pipelines that fetch the latest translations and rebuild a static site.


Rate limiting and caching

Every request must be authenticated, and Lang Forge adds no cache headers or rate limits of its own.


Documentation and examples

Full endpoint documentation, with request/response examples and authentication walkthroughs, lives in our documentation →.


Ready to build a headless multilingual site?

See pricing →

The REST API is included in every paid plan and in the free version on WordPress.org. The translation memory and analytics endpoints are part of Pro.

Forge AI Assistant Online

Hi! I'm the Lang Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs