SkyServer: Application Programmer's Interface
 
API: Programmer's Interface
DR8 Help
 Start Here
 FAQ
 Glossary
 Cooking with Sloan
 Tool User Guides
 Contact Help Desk
 
 Searching SDSS-III
 SQL Tutorial
 SQL in SkyServer
 About the Database
 Table Descriptions
 Sample SQL Queries
 Schema Browser
 Searching Advice
 Query Limits
 
 Details of the Data
 Algorithms
 Data Publications
 API

Many of the tools on this site may be called programatically or may be included in your own website or tutorial pages. A URL may be constructed for the ASP pages passing parameters in the query string. Examples are provided below.

Image access

Get Frame

http://skyserver.sdss.org/dr8/en/get/frameByRCFZ.asp?R=1140&C=1&F=120&Z=12 
where R is the Run, C is the CamCol and Z is the Zoom level (Z can be either 12, 25, 50 or 0 (for 100%)), or
 http://skyserver.sdss.org/dr8/en/get/frameById.asp?id=1237650369404207104&zoom=12 
where id is the fieldId.


Get Spectra

http://skyserver.sdss.org/dr8/en/get/specByPF.asp?P=299489402567026688&F=25  
where P is the Plate and F is the Fiber, or
http://skyserver.sdss.org/dr8/en/get/specById.asp?ID=301889361622886400 
where ID is the SpecObjId.


Get Scrolling Sky image

http://skyserver.sdss.org/dr8/en/tools/scroll/camcol.asp?R=1140&C=1&Z=25 
Where R is the Run number , C is the CamCol and Z is the Zoom level. Z can be either 12, 25, 50 or 0 (for 100%).


Full Spectral Access

There is a comprehensive web site to access the details of spectra from the SDSS and other surveys (2dF). You can also upload your own spectra.

http://www.voservices.net/spectrum/

This site also has a Filter Profile service and a SOAP interface to the spectrum service described in its documentation page .

Searching

Radial

http://skyserver.sdss.org/dr8/en/tools/search/x_radial.asp?
ra=180&dec=-0.2&radius=3&format=csv&topnum=20 
where ra is Right Ascension in degrees, dec is Declination in degrees, radius is search radius in arcminutes, format is the format to return, which may be csv, html, or xml, topnum is the number of rows to return. If you want all rows, put entries=all instead.

Additional parameters may be passed for restricting its range. For each band (x one of r,i,u,g,z) check_x,min_x and max_x may be specified. Hence adding to the above we may restrict the result to rows with u between 20 and 22 as follows:

http://skyserver.sdss.org/dr8/en/tools/search/x_radial.asp?
ra=180&dec=-0.2&radius=3&format=xml&topnum=20&check_u=u&min_u=20&max_u=22 

The same parameters can be also sent using POST. The names forms are the same as the GET parameter names.


Rectangular

http://skyserver.sdss.org/dr8/en/tools/search/x_rect.asp?
min_ra=180.1&max_ra=180.2&min_dec=-0.1&max_dec=0.01&format=xml&topnum=20 
where min_ra,min_dec in degrees form one corner, max_ra,max_dec form the other corner, format is the format to return which may be csv, html, or xml, topnum is the number of rows to return. If you want all rows, put entries=all instead.

The same parameters can be also sent using POST. The names forms are the same as the GET parameter names.


SQL

http://skyserver.sdss.org/dr8/en/tools/search/x_sql.asp?
format=xml&cmd=select top 10 * from galaxy  
Where cmd is the sql command to execute and format is the format to return which may be csv, html, or xml. The command should be preferably URL-encoded, like
    &cmd=SELECT+TOP+10+*+FROM+Galaxy+WHERE+r%3C17

The same parameters can be also sent using POST. The POST parameter values can be in plain text, they do not need to be encoded. The names forms are the same as the GET parameter names.

Visualization Tools

Image Cutout

This is a Web Service that returns a JPEG image centered on (ra,dec), of size (height x width) where the image is scaled to an arbitrary scale (scale). Various drawing options can be specified (opt). The image cutout may be called using SOAP or through a HTTP interface, using either GET or POST. It can be also included in a page through the URL in an IMG tag.

For information on writing a Java SOAP client see ImgCutOut DIME page.
The ImgCutout page itself contains information on building url's but here is an example also:

http://skyservice.pha.jhu.edu/DR8/ImgCutout/getjpeg.aspx
ra=224.5941&dec=-1.09&width=512&height=512&opt=OG 
where ra is Right Ascension in degrees, dec is declination in degrees,
scale is the scale of the image in arcsec per pixel, 0.4 is default
opt is a string of charectors for overlays on the image codes are :
    Code Effect on image
    GGrid
    LLabel
    PPhotoObjs
    SSpecObjs
    TTargetObjs
    OOutline
    BBoundingBox
    FFields
    MMasks
    QPlates
    IInvertImage

Finding Chart

The page, built on top of the Cutout service, creates a Finding Chart, centered on the specified location at a specified scale. Properly formatted finding charts can be sent to the printer. The printed image is always inverted for better looking prints.

You may jump directly to a particular location with the navigation tool using:

http://skyserver.sdss.org/dr8/en/tools/chart/chart.asp?ra=184.9511&dec=-0.8754&opt=GO
where ra is Right Ascension in degrees, dec is Declination in degrees,
scale is the scale of the image in arcsec per pixel, 0.4 is default
opt is a string of characters, as listed above for the cutout service.


Navigate

This page, built from the Cutout service provides easy navigation in the vicinity of a given point on the sky. One can move around by clicking on the frame of the image, or on individual objects. A short list of the basic properties and a magnified thumbnail \ image of the object nearest to the selected point is then displayed.

You may jump directly to a particular location with the navigation tool using:

http://skyserver.sdss.org/dr8/en/tools/chart/navi.asp?ra=184.9511&dec=-0.8754&opt=GO
where ra is Right Ascension in degrees, dec is declination in degrees,
scale is the scale of the image in arcsec per pixel, 0.4 is default
opt is a string of characters, as seen above.


ImgList

This page, built from the Cutout service, can generate thumbnails of SDSS images based upon a user defined list of object positions. The images are linked to the other tools. The list can also be specified with a query. The page can be called via HTTP POST.
You will need a form such as the following :
<form action="http://skyserver.sdss.org/dr8/en/tools/chart/showlist.asp"
method="post">
<TEXTAREA name="paste">
    ra     dec  
159.815 -0.655
161.051  0.152
161.739  0.893
164.090 -0.889
</TEXTAREA>
<input type="submit">
</form>
Basically you must post to the server a field called "paste" which contains the list of thumbnails you require.


Explore

The Explore Tool contains a summary of an object, and interactive links to further detailed properties, like its spectrum or neighbors, etc.
http://skyserver.sdss.org/dr8/en/tools/explore/obj.asp?id=1237654386268439267 
where id is the objId, or
http://skyserver.sdss.org/dr8/en/tools/explore/obj.asp?ra=180.6&dec=0.2
where ra is Right Ascension in degrees, dec is declination in degrees, or
http://skyserver.sdss.org/dr8/en/tools/explore/obj.asp?sid=299492151346096128
where sid is the SpecObjId, or
http://skyserver.sdss.org/dr8/en/tools/explore/obj.asp?plate=266&fiberid=100
where plate is the plate and fiber is the fiberid.

Cross-identification

You can search for photometric (image) and/or spectroscopic objects using the same cross-id form. You may use POST or GET methods to this URL - the basic form is as follows.

The GET method (example for default crossid page):

http://sdssorgdev/dev/en/tools/crossid/x_crossid.asp?searchType=photo&photoScope=nearPrim&photoUpType=ra-dec&radius=0.5&firstcol=1&paste=++name++ra+++++++dec%0D%0A++A1+++195.2++++2.5%0D%0A++A2+++194.5++++2.6%0D%0A++A3+++193.6++++2.8%0D%0A++A4+++-90.1++++-90.051%0D%0A&upload=&uquery=SELECT+%0D%0A+++p.objID%2C+p.ra%2C+p.dec%2C+p.run%2C+p.rerun%2C+p.camcol%2C+p.field%2C%0D%0A+++dbo.fPhotoTypeN(p.type)+as+type%2C%0D%0A+++p.modelMag_u%2C+p.modelMag_g%2C+p.modelMag_r%2C+p.modelMag_i%2C+p.modelMag_z+%0D%0AFROM+%23x+x%2C+%23upload+u%2C+PhotoTag+p%0D%0AWHERE+u.up_id+%3D+x.up_id+and+x.objID%3Dp.objID+%0D%0AORDER+BY+x.up_id%0D%0A%09%09&format=html
	

The POST method:

<FORM METHOD="post" ENCTYPE="multipart/form-data" ACTION="http://skyserver.sdss.org/dr8/en/tools/crossid/x_crossid.asp" id="crossid" name="crossid">
<input id="searchType1" name="searchType" value="photo" type=radio class="box" CHECKED>
<input id="photoScope1" name="photoScope" value="nearPrim" type=radio class="box" CHECKED>Nearest Primary Object</input>
<input id="photoScope2" name="photoScope" value="nearObj" type=radio class="box">Nearest Object</input>
<input id="photoScope3" name="photoScope" value="allPrim" type=radio class="box">All Nearby Primary Objects</input>
<input id="photoScope4" name="photoScope" value="allObj" type=radio class="box">All Nearby Objects</input>
<input id="photoUpType1" name="photoUpType" value="ra-dec" type=radio class="box"  CHECKED>RA, dec</input>
<input id="photoUpType2" name="photoUpType" value="run-rerun" type=radio class="box">run-rerun-camcol-field-obj</input>
<input id="joinSpec" name="joinSpec" type="checkbox">Spectra</input>
<input id="searchType1" name="searchType" value="spectro" type="radio" class="box">
<input id="spectroScope1" name="spectroScope" value="nearPrim" type=radio class="box" CHECKED DISABLED>Nearest Primary Spectrum</input>
<input id="spectroScope2" name="spectroScope" value="nearObj" type=radio class="box" DISABLED>Nearest Spectrum</input>
<input id="spectroScope3" name="spectroScope" value="allPrim" type=radio class="box" DISABLED>All Nearby Primary Spectra</input>
<input id="spectroScope4" name="spectroScope" value="allObj" type=radio class="box" DISABLED>All Nearby Spectra</input>
<input id="spectroUpType1" name="spectroUpType" value="ra-dec" type=radio class="box" DISABLED CHECKED>RA, dec</input>
<input id="spectroUpType2" name="spectroUpType" value="plate-mjd-fiber" type=radio class="box" DISABLED>plate-MJD-fiberID</input>
<input id="joinPhoto" name="joinPhoto" type="checkbox" DISABLED>Images</input
<input id=radius name=radius VALUE="0.5" SIZE="3">
<input id=firstcol name=firstcol VALUE="1" SIZE="1">
<TEXTAREA cols='40' name='paste' id='paste' rows='4' wrap='virtual' class='med'></TEXTAREA>
<INPUT TYPE="File" NAME="upload" size=32 >
<TEXTAREA cols='85' name='uquery' rows='6' wrap='virtual' class='med'></TEXTAREA> 
<input id=submit type=submit value=Submit class="button">
<input name=format value="html" type=radio class="box" CHECKED>
<input name=format value="xml"  type=radio class="box">
<input name=format value="csv"  type=radio class="box">
<input TYPE="reset" VALUE="Reset " class="button" id="reset" name="reset">