Getting Google Meet attendance statistics in the context of Google Classroom via the API requires a bit more research into how Classroom and Meet are related. You correctly noted that activities.list requires meet_code, but the Google API doesn't provide a direct way to extract all Meet codes associated with a specific username or course.
One workaround I found was to use the courses.courseWork.list and courses.courseWorkMaterials.list APIs in Google Classroom. Sometimes, links to Meet meetings are stored in assignments or course materials, and you can try to extract them from there. However, this does not guarantee that all sessions will be found.
Another option is if you have access to Google Workspace logs via the Admin SDK Reports API, you can try meet_log_events, which records user activity in Meet. Here you can filter by email address or other attributes, which can help you find all meetings organized by a specific teacher.
If the task is not only to obtain meeting codes, but also to analyze the data, then you can connect third-party services, such as Sembly AI. It allows you to automatically record and analyze meetings, as well as record participants and their activity. You can integrate it with Google Meet and get detailed reports without having to manually pull statistics through the API.
Google does not yet offer a convenient solution for automatically obtaining all Meet codes by nickname.