work out domain in external json call