If the data from the file may contain spaces, and you have no objection to spaces in the file name in the /home/user/archive directory, then what you have should be fine.
Given the contents of the rest of the URL, you can simply write:
while read line do curl "https://gdata.youtube.com/feeds/api/users/${line}/subscriptions?v=2&alt=json" \ > "/home/user/archive/${line}" done < textfile.txt
where strictly ${line} can be just $line in both places. This works because strings are fixed and do not contain shell metacharacters.
Since your code is close to this, but you claim to see keywords from a file elsewhere, there may be a slight rewrite to facilitate debugging in order:
while read line do url="https://gdata.youtube.com/feeds/api/users/${line}/subscriptions?v=2&alt=json" file="/home/user/archive/${line}" curl "$url" > "$file" done < textfile.txt
Since strings can contain spaces, it seems (do you need to expand spaces to + in the URL?), It is strongly recommended to use quotes around variables. Now you can run the script with sh -x (or add the set -x line to the script) and see what the shell thinks, what it does, how it does it.
source share