Kepler's 3rd law could have been deduced based on the orbital parameters mentioned in Ptolemy's Almagest (of the 2nd century CE). It was not important for this that Kepler had more modern observations of higher accuracy available to him, nor that he had discovered that the orbits were ellipses instead of circles. The following chart shows the orbital sizes (a) and periods (P) deduced from the Almagest as little squares, and shows Kepler's 3rd law as a straight line. The correspondence is good enough to deduce Kepler's 3rd law from the data points.

The crucial insight, first obtained by Copernicus (see his Commentariolus, written some time before 1514), was that the heliocentric model of the Solar System allowed for the sizes of the orbits (relative to that of the Earth) to be derived from the available observations. Without this insight, Kepler would not have known the sizes of the planets' orbits, and would not have had the data from which to deduce his 3rd law.
For an inferior planet, closer to the Sun than Earth is, the size of their orbit relative to that of the Earth determines their greatest angular distance from the Sun (their maximum elongation) as seen from Earth. In terms of the geocentric model used in the Almagest, the size of the orbit corresponds to the size of the epicycle of the planet.
For a superior planet, further from the Sun than the Earth is, the size of the Earth's orbit relative to that of the planet determines the size of the planet's opposition loop where the planet shows apparent retrograde motion near its opposition to the Sun. In terms of the geocentric model, the size of the epicycle of the planet corresponds to one over the size of the orbit, because the epicycle of the planet is equivalent to the orbit of the Earth.
Ptolemy gives the sizes of the epicycles as
- Mercury: 22;30 = 22.5 out of 60 (Almagest, IX 9, Toomer Edition)
- Venus: 43 + 1/6 out of 60 (X 2)
- Mars: 39;30 = 39.5 out of 60 (X 8)
- Jupiter: 11;30 = 11.5 out of 60 (XI 2)
- Saturn: 6;30 = 6.5 out of 60 (XI 6)
The deduced orbital sizes are, relative to that of the Earth:
- Mercury: 22.5/60 = 0.375
- Venus: 43.17/60 = 0.7194
- Earth: 1
- Mars: 60/39.5 = 1.5190
- Jupiter: 60/11.5 = 5.2174
- Saturn: 60/6.5 = 9.2308
The planet's orbital period follows from their mean daily motion in longitude (for superior planets) or anomaly (for inferior planets). Ptolemy gives the following mean daily motions in anomaly (degrees per day), i.e., motion along the epicycle:
- Mercury: 3;6,24,6,59,35,50 = 3.106699 (IX 3)
- Venus: 0;36,59,25,53,11,28 = 0.6165087 (IX 3)
and the following mean daily motions in longitude (degrees per day), i.e., motion along the deferent:
- Sun: 0;59,8,17,13,12,31 = 0.9856353 (III 1)
- Mars: 0;31,26,36,53,51,33 = 0.5240597 (IX 3)
- Jupiter: 0;4,59,14,26,46,31 = 0.08312244 (IX 3)
- Saturn: 0;2,0,33,31,28,51 = 0.03348854 (IX 3)
For the inferior planets, we have to add the Sun's motion in longitude to the planet's motion in anomaly to get their motion relative to the celestial sphere. The deduced orbital periods in days and years are
- Mercury: 360/(3.106699 + 0.9856353) = 87.96935 → 0.2408492
- Venus: 360/(0.6165087 + 0.9856353) = 224.6989 → 0.6151977
- Earth: 360/0.9856353 = 365.2467 → 1
- Mars: 360/0.5240597 = 686.9446 → 1.880769
- Jupiter: 3606/0.08312244 = 4330.961 → 11.85763
- Saturn: 360/0.03348854 = 10749.95 → 29.43202
These orbital sizes and periods are displayed in the chart.
It might be that the mean daily motions still need to be corrected for precession (said by Ptolemy to work at a rate of 1 degree per 100 years), but that makes very little difference to the chart.