> For the complete documentation index, see [llms.txt](https://docs.openreview.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openreview.net/~/changes/kVYMUwjISEF9x7H1lfSE/how-to-guides/data-retrieval-and-modification/how-to-loop-through-accepted-papers-and-print-the-authors-and-their-affiliations.md).

# How to loop through Accepted Papers and print the Authors and their Affiliations

1. If you have not done so, you will need to [install and instantiate the openreview-py client](/~/changes/kVYMUwjISEF9x7H1lfSE/getting-started/using-the-api/installing-and-instantiating-the-python-client.md).&#x20;
2. Get all the accepted papers for your venue. The value for 'venue' is the Abbreviated Venue Name which can be located on the venue request form and the venue homepage underneath the official venue name. For example, 'SaTML 2023' is an abbreviated venue name, be sure to include yours in its place.

```
accepted_papers = client.get_all_notes(content={ 'venue': 'SaTML 2023'})
```

3\. Iterate through each accepted paper, printing the number and title of the paper. To get the affiliations for each author, get the profiles by passing the author IDs in the content of the accepted paper. Iterate through the author profile and print the author's preferred name and history containing the affiliation.

```
for accepted_paper in accepted_papers:
    print(accepted_paper.number, accepted_paper.content['title'])
    author_profiles = openreview.tools.get_profiles(client, accepted_paper.content['authorids'])
    for author_profile in author_profiles:
        print(author_profile.get_preferred_name(pretty=True), author_profile.content.get('history', [{}])[0])
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.openreview.net/~/changes/kVYMUwjISEF9x7H1lfSE/how-to-guides/data-retrieval-and-modification/how-to-loop-through-accepted-papers-and-print-the-authors-and-their-affiliations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
