You are making a Request with an encoded url. Scrapy is encoding it again and it looks like the objective website doesn't support double-encoding.
Also, it is important to mention that some websites with API endpoints have a protection which consists in checking if you have already a session. This is clearly to avoid direct requests to their endpoints. So in this cases it is always recommended to make a first "fake" request (which will generate a session) before querying their API/endpoint.
An example of the above is this answer on SO:
https://stackoverflow.com/a/33542753/4120036
Just check how it first makes a request to LOGIN_PAGE:
s.get(LOGIN_URL)
And then it makes the login post request:
login_response = s.post(LOGIN_URL, data=payload, headers={'Referer':'http://infotrac.galegroup.com/default/palm83799?db=SP19', 'Content-Type':'application/x-www-form-urlencoded'})
I've decoded the website URL, added X-Requested-With and Referer headers and it now returns the same amount of data as from your browser:
# -*- coding: utf-8 -*-
import scrapy
from scrapy.http.request import Request
class test(scrapy.Spider):
name = "test"
allowed_domains = ["ar.trivago.com"]
def start_requests(self):
headers = {
'Referer': "http://ar.trivago.com/?iPathId=38715&iGeoDistanceItem=47160&aDateRange[arr]=2016-01-01&aDateRange[dep]=2016-01-02&iRoomType=7&tgs=4716002&aHotelTestClassifier=&aPriceRange[from]=0&aPriceRange[to]=0&iIncludeAll=0&iGeoDistanceLimit=20000&aPartner=&iViewType=0&bIsSeoPage=false&bIsSitemap=false&",
'X-Requested-With':'XMLHttpRequest'
}
fake_request = Request("http://ar.trivago.com/search/region?iPathId=38715&iGeoDistanceItem=47160&aDateRange[arr]=2015-11-13&aDateRange[dep]=2015-11-14&iRoomType=7&tgs=4716002&aHotelTestClassifier=&aPriceRange[from]=0&aPriceRange[to]=0&iIncludeAll=0&iGeoDistanceLimit=20000&aPartner=&iViewType=0&bIsSeoPage=false&bIsSitemap=false&&_=1446825699501", headers=headers)
yield Request("http://ar.trivago.com/search/region?iPathId=38715&iGeoDistanceItem=47160&aDateRange[arr]=2015-11-13&aDateRange[dep]=2015-11-14&iRoomType=7&tgs=4716002&aHotelTestClassifier=&aPriceRange[from]=0&aPriceRange[to]=0&iIncludeAll=0&iGeoDistanceLimit=20000&aPartner=&iViewType=0&bIsSeoPage=false&bIsSitemap=false&&_=1446825699501",
callback=self.parse, headers=headers)
def parse(self, response):
print "RESPONSE:", response.body