get field api name in apex code example
Example: apex get object fields by api name
SObjectType objectType = Schema.getGlobalDescribe().get('<Object API Name>');
Map<String,Schema.SObjectField> fieldMap = objectType.getDescribe().fields.getMap();
SObjectType objectType = Schema.getGlobalDescribe().get('<Object API Name>');
Map<String,Schema.SObjectField> fieldMap = objectType.getDescribe().fields.getMap();