Overview
I had the opportunity to get a list of untranslated nodes in Drupal, so this is a personal note for future reference.
Method
There are various approaches, but this time I use JSON:API.
Let’s assume the master language is Japanese (ja) and the translation language to add is English (en).
Using JSON:API, for example, for a taxonomy called collection, you can retrieve it with the following:
https://xxx/jsonapi/taxonomy_term/collection
Additionally, by adding /en as follows, if a translation node exists, that information is returned.
https://xxx/en/jsonapi/taxonomy_term/collection
In this case, if a translation node exists, attributes/langcode becomes en, but for nodes without translations, it remains ja.
Using this property, when a language code different from the specified language is contained in langcode, it can be extracted as a node without a translation for that language.
Note that based on the JSON:API specification, pagination can be performed using page queries as follows. This is used for bulk data retrieval.
https://xxx/en/jsonapi/taxonomy_term/collection?page[offset]=50&page[limit]=50
Summary
There may be better methods, but I hope this serves as a useful reference.