Twig field collection theme get field id
You can get The field collection item ID in field-collection-item.html.twig

{{ item['#field_collection_item'].id() }}


or you can get it from field-collection-item--field-name.html.twig, or other field template of field collection item.

{{ element['#items'].getEntity().id() }}


You can find these functions under Available Methods Tab when you printing out variables from twig template. You can use public methods.