outcome  year           championship   surface  opponent in the final                     score in the final
0   runner - up  2007       indian wells (1)      hard           rafael nadal                          2 - 6 , 5 - 7
1        winner  2007              miami (1)      hard        guillermo cañas                  6 - 3 , 6 - 2 , 6 - 4
2        winner  2007  montréal (canada) (1)      hard          roger federer  7 - 6 (7 - 2) , 2 - 6 , 7 - 6 (7 - 2)
3        winner  2008       indian wells (1)      hard             mardy fish                  6 - 2 , 5 - 7 , 6 - 3
4        winner  2008               rome (1)      clay     stanislas wawrinka                  4 - 6 , 6 - 3 , 6 - 3
5   runner - up  2008         cincinnati (1)      hard            andy murray          6 - 7 (4 - 7) , 6 - 7 (5 - 7)
6   runner - up  2009              miami (1)      hard            andy murray                          2 - 6 , 5 - 7
7   runner - up  2009        monte carlo (1)      clay           rafael nadal                  3 - 6 , 6 - 2 , 1 - 6
8   runner - up  2009               rome (1)      clay           rafael nadal                  6 - 7 (2 - 7) , 2 - 6
9   runner - up  2009         cincinnati (2)      hard          roger federer                          1 - 6 , 5 - 7
10       winner  2009              paris (1)  hard (i)           gaël monfils          6 - 2 , 5 - 7 , 7 - 6 (7 - 3)
11       winner  2011       indian wells (2)      hard           rafael nadal                  4 - 6 , 6 - 3 , 6 - 2
12       winner  2011              miami (2)      hard           rafael nadal          4 - 6 , 6 - 3 , 7 - 6 (7 - 4)
13       winner  2011             madrid (1)      clay           rafael nadal                          7 - 5 , 6 - 4
14       winner  2011               rome (2)      clay           rafael nadal                          6 - 4 , 6 - 4
15       winner  2011  montréal (canada) (2)      hard             mardy fish                  6 - 2 , 3 - 6 , 6 - 4
16  runner - up  2011         cincinnati (3)      hard            andy murray                      4 - 6 , 0 - 3 ret
17       winner  2012              miami (3)      hard            andy murray                  6 - 1 , 7 - 6 (7 - 4)
18  runner - up  2012        monte carlo (2)      clay           rafael nadal                          3 - 6 , 1 - 6
19  runner - up  2012               rome (2)      clay           rafael nadal                          5 - 7 , 3 - 6
20       winner  2012   toronto (canada) (3)      hard        richard gasquet                          6 - 3 , 6 - 2
21  runner - up  2012         cincinnati (4)      hard          roger federer                  0 - 6 , 6 - 7 (7 - 9)
22       winner  2012           shanghai (1)      hard            andy murray        5 - 7 , 7 - 6 (13 - 11) , 6 - 3
23       winner  2013        monte carlo (1)      clay           rafael nadal                  6 - 2 , 7 - 6 (7 - 1)
24       winner  2013           shanghai (2)      hard  juan martín del potro          6 - 1 , 3 - 6 , 7 - 6 (7 - 3)

Table as JSON:
{"outcome":{"0":"runner - up","1":"winner","2":"winner","3":"winner","4":"winner","5":"runner - up","6":"runner - up","7":"runner - up","8":"runner - up","9":"runner - up","10":"winner","11":"winner","12":"winner","13":"winner","14":"winner","15":"winner","16":"runner - up","17":"winner","18":"runner - up","19":"runner - up","20":"winner","21":"runner - up","22":"winner","23":"winner","24":"winner"},"year":{"0":2007,"1":2007,"2":2007,"3":2008,"4":2008,"5":2008,"6":2009,"7":2009,"8":2009,"9":2009,"10":2009,"11":2011,"12":2011,"13":2011,"14":2011,"15":2011,"16":2011,"17":2012,"18":2012,"19":2012,"20":2012,"21":2012,"22":2012,"23":2013,"24":2013},"championship":{"0":"indian wells (1)","1":"miami (1)","2":"montréal (canada) (1)","3":"indian wells (1)","4":"rome (1)","5":"cincinnati (1)","6":"miami (1)","7":"monte carlo (1)","8":"rome (1)","9":"cincinnati (2)","10":"paris (1)","11":"indian wells (2)","12":"miami (2)","13":"madrid (1)","14":"rome (2)","15":"montréal (canada) (2)","16":"cincinnati (3)","17":"miami (3)","18":"monte carlo (2)","19":"rome (2)","20":"toronto (canada) (3)","21":"cincinnati (4)","22":"shanghai (1)","23":"monte carlo (1)","24":"shanghai (2)"},"surface":{"0":"hard","1":"hard","2":"hard","3":"hard","4":"clay","5":"hard","6":"hard","7":"clay","8":"clay","9":"hard","10":"hard (i)","11":"hard","12":"hard","13":"clay","14":"clay","15":"hard","16":"hard","17":"hard","18":"clay","19":"clay","20":"hard","21":"hard","22":"hard","23":"clay","24":"hard"},"opponent in the final":{"0":"rafael nadal","1":"guillermo cañas","2":"roger federer","3":"mardy fish","4":"stanislas wawrinka","5":"andy murray","6":"andy murray","7":"rafael nadal","8":"rafael nadal","9":"roger federer","10":"gaël monfils","11":"rafael nadal","12":"rafael nadal","13":"rafael nadal","14":"rafael nadal","15":"mardy fish","16":"andy murray","17":"andy murray","18":"rafael nadal","19":"rafael nadal","20":"richard gasquet","21":"roger federer","22":"andy murray","23":"rafael nadal","24":"juan martín del potro"},"score in the final":{"0":"2 - 6 , 5 - 7","1":"6 - 3 , 6 - 2 , 6 - 4","2":"7 - 6 (7 - 2) , 2 - 6 , 7 - 6 (7 - 2)","3":"6 - 2 , 5 - 7 , 6 - 3","4":"4 - 6 , 6 - 3 , 6 - 3","5":"6 - 7 (4 - 7) , 6 - 7 (5 - 7)","6":"2 - 6 , 5 - 7","7":"3 - 6 , 6 - 2 , 1 - 6","8":"6 - 7 (2 - 7) , 2 - 6","9":"1 - 6 , 5 - 7","10":"6 - 2 , 5 - 7 , 7 - 6 (7 - 3)","11":"4 - 6 , 6 - 3 , 6 - 2","12":"4 - 6 , 6 - 3 , 7 - 6 (7 - 4)","13":"7 - 5 , 6 - 4","14":"6 - 4 , 6 - 4","15":"6 - 2 , 3 - 6 , 6 - 4","16":"4 - 6 , 0 - 3 ret","17":"6 - 1 , 7 - 6 (7 - 4)","18":"3 - 6 , 1 - 6","19":"5 - 7 , 3 - 6","20":"6 - 3 , 6 - 2","21":"0 - 6 , 6 - 7 (7 - 9)","22":"5 - 7 , 7 - 6 (13 - 11) , 6 - 3","23":"6 - 2 , 7 - 6 (7 - 1)","24":"6 - 1 , 3 - 6 , 7 - 6 (7 - 3)"}}