This is complicated, you don’t want to be doing GET reqs to a third party when random people browse your site unless this is heavily gated.
The simplest solution here is to do the lookups up front and store the resolved value in the custom field and not a custom identifier to the 3rd party. If you must store the identifier in another field and do lookups on a regular basis.