I agree with cannonsr that "a basket an hour" is interchangeable with "a basket per hour." We do this frequently in English. "I earn $8 an hour" "I'm driving 65 miles an hour."
"a" is a synonym for "per". And "an" is used in your sentence instead of "a" because of the leading vowel sound in "hour" but it still has to mean the same as "a". So unless there is some rule against "an" meaning "per" I say your translation is acceptable
"By hour" isn't grammatical in English. It would sound more correct to say "by the hour," but "per hour" sounds better still. I believe "per hour" is also a closer translation of "por hora."