I have been watching some videos on Complex Analysis and from my understanding, integrating an analytic function over a curve only depends on the endpoints of the curve.
If that is true, why does $\int dz/z$ evaluated along the unit circle equal $2\pi i$ instead of $0$?
Yes, $\int_{\lvert z\rvert=1}\frac{\mathrm dz}z=2\pi i$. And therefore, no, it is not true that integrating an analytic function over a curve only depends on the endpoints of the curve. Because if you go from $1$ to $-1$ along a semicircle in the upper half plane, the value of the integral is $\pi i$, whereas if you go from $1$ to $-1$ along a semicircle in the lower half plane, the value of the integral is $-\pi i$.